public final class GlowScheduler extends Object implements org.bukkit.scheduler.BukkitScheduler
Constructor and Description |
---|
GlowScheduler(GlowServer server,
WorldScheduler worlds)
Creates a new task scheduler.
|
GlowScheduler(org.bukkit.Server server,
WorldScheduler worlds,
SessionRegistry sessionRegistry)
Creates a new task scheduler.
|
Modifier and Type | Method and Description |
---|---|
<T> Future<T> |
callSyncMethod(org.bukkit.plugin.Plugin plugin,
Callable<T> task) |
void |
cancelAllTasks() |
void |
cancelTask(int taskId) |
void |
cancelTasks(org.bukkit.plugin.Plugin plugin) |
List<org.bukkit.scheduler.BukkitWorker> |
getActiveWorkers()
Returns active async tasks.
|
List<org.bukkit.scheduler.BukkitTask> |
getPendingTasks()
Returns tasks that still have at least one run remaining.
|
boolean |
isCurrentlyRunning(int taskId) |
boolean |
isPrimaryThread()
Checks if the current
Thread is the server's primary thread. |
boolean |
isQueued(int taskId) |
org.bukkit.scheduler.BukkitTask |
runTask(org.bukkit.plugin.Plugin plugin,
org.bukkit.scheduler.BukkitRunnable task)
Deprecated.
|
org.bukkit.scheduler.BukkitTask |
runTask(org.bukkit.plugin.Plugin plugin,
Runnable task) |
org.bukkit.scheduler.BukkitTask |
runTaskAsynchronously(org.bukkit.plugin.Plugin plugin,
org.bukkit.scheduler.BukkitRunnable task)
Deprecated.
|
org.bukkit.scheduler.BukkitTask |
runTaskAsynchronously(org.bukkit.plugin.Plugin plugin,
Runnable task) |
org.bukkit.scheduler.BukkitTask |
runTaskLater(org.bukkit.plugin.Plugin plugin,
org.bukkit.scheduler.BukkitRunnable task,
long delay)
Deprecated.
|
org.bukkit.scheduler.BukkitTask |
runTaskLater(org.bukkit.plugin.Plugin plugin,
Runnable task,
long delay) |
org.bukkit.scheduler.BukkitTask |
runTaskLaterAsynchronously(org.bukkit.plugin.Plugin plugin,
org.bukkit.scheduler.BukkitRunnable task,
long delay)
Deprecated.
|
org.bukkit.scheduler.BukkitTask |
runTaskLaterAsynchronously(org.bukkit.plugin.Plugin plugin,
Runnable task,
long delay) |
org.bukkit.scheduler.BukkitTask |
runTaskTimer(org.bukkit.plugin.Plugin plugin,
org.bukkit.scheduler.BukkitRunnable task,
long delay,
long period)
Deprecated.
|
org.bukkit.scheduler.BukkitTask |
runTaskTimer(org.bukkit.plugin.Plugin plugin,
Runnable task,
long delay,
long period) |
org.bukkit.scheduler.BukkitTask |
runTaskTimerAsynchronously(org.bukkit.plugin.Plugin plugin,
org.bukkit.scheduler.BukkitRunnable task,
long delay,
long period)
Deprecated.
|
org.bukkit.scheduler.BukkitTask |
runTaskTimerAsynchronously(org.bukkit.plugin.Plugin plugin,
Runnable task,
long delay,
long period) |
int |
scheduleAsyncDelayedTask(org.bukkit.plugin.Plugin plugin,
Runnable task)
Deprecated.
|
int |
scheduleAsyncDelayedTask(org.bukkit.plugin.Plugin plugin,
Runnable task,
long delay)
Deprecated.
|
int |
scheduleAsyncRepeatingTask(org.bukkit.plugin.Plugin plugin,
Runnable task,
long delay,
long period)
Deprecated.
|
void |
scheduleInTickExecution(Runnable run)
Schedules the given task for the start of the next tick.
|
int |
scheduleSyncDelayedTask(org.bukkit.plugin.Plugin plugin,
org.bukkit.scheduler.BukkitRunnable task)
Deprecated.
|
int |
scheduleSyncDelayedTask(org.bukkit.plugin.Plugin plugin,
org.bukkit.scheduler.BukkitRunnable task,
long delay)
Deprecated.
|
int |
scheduleSyncDelayedTask(org.bukkit.plugin.Plugin plugin,
Runnable task) |
int |
scheduleSyncDelayedTask(org.bukkit.plugin.Plugin plugin,
Runnable task,
long delay) |
int |
scheduleSyncRepeatingTask(org.bukkit.plugin.Plugin plugin,
org.bukkit.scheduler.BukkitRunnable task,
long delay,
long period)
Deprecated.
|
int |
scheduleSyncRepeatingTask(org.bukkit.plugin.Plugin plugin,
Runnable task,
long delay,
long period) |
void |
start()
Starts running ticks.
|
void |
stop()
Stops the scheduler and all tasks.
|
<T> T |
syncIfNeeded(Callable<T> task)
Runs a task on the primary thread, and blocks waiting for it to finish.
|
public GlowScheduler(GlowServer server, WorldScheduler worlds)
server
- The server that will use this scheduler.worlds
- The WorldScheduler
this scheduler will use for ticking the server's
worlds.public GlowScheduler(org.bukkit.Server server, WorldScheduler worlds, SessionRegistry sessionRegistry)
server
- The server that will use this scheduler.worlds
- The WorldScheduler
this scheduler will use for ticking the server's
worlds.sessionRegistry
- The SessionRegistry
this scheduler will use to tick playerspublic void start()
public void stop()
public boolean isPrimaryThread()
Thread
is the server's primary thread.Thread
is the server's primary thread.public void scheduleInTickExecution(Runnable run)
run
- the task to runpublic int scheduleSyncDelayedTask(org.bukkit.plugin.Plugin plugin, Runnable task)
scheduleSyncDelayedTask
in interface org.bukkit.scheduler.BukkitScheduler
public int scheduleSyncDelayedTask(org.bukkit.plugin.Plugin plugin, Runnable task, long delay)
scheduleSyncDelayedTask
in interface org.bukkit.scheduler.BukkitScheduler
@Deprecated public int scheduleSyncDelayedTask(org.bukkit.plugin.Plugin plugin, org.bukkit.scheduler.BukkitRunnable task)
scheduleSyncDelayedTask
in interface org.bukkit.scheduler.BukkitScheduler
@Deprecated public int scheduleSyncDelayedTask(org.bukkit.plugin.Plugin plugin, org.bukkit.scheduler.BukkitRunnable task, long delay)
scheduleSyncDelayedTask
in interface org.bukkit.scheduler.BukkitScheduler
public int scheduleSyncRepeatingTask(org.bukkit.plugin.Plugin plugin, Runnable task, long delay, long period)
scheduleSyncRepeatingTask
in interface org.bukkit.scheduler.BukkitScheduler
@Deprecated public int scheduleSyncRepeatingTask(org.bukkit.plugin.Plugin plugin, org.bukkit.scheduler.BukkitRunnable task, long delay, long period)
scheduleSyncRepeatingTask
in interface org.bukkit.scheduler.BukkitScheduler
@Deprecated public int scheduleAsyncDelayedTask(org.bukkit.plugin.Plugin plugin, Runnable task, long delay)
scheduleAsyncDelayedTask
in interface org.bukkit.scheduler.BukkitScheduler
@Deprecated public int scheduleAsyncDelayedTask(org.bukkit.plugin.Plugin plugin, Runnable task)
scheduleAsyncDelayedTask
in interface org.bukkit.scheduler.BukkitScheduler
@Deprecated public int scheduleAsyncRepeatingTask(org.bukkit.plugin.Plugin plugin, Runnable task, long delay, long period)
scheduleAsyncRepeatingTask
in interface org.bukkit.scheduler.BukkitScheduler
public org.bukkit.scheduler.BukkitTask runTask(org.bukkit.plugin.Plugin plugin, Runnable task) throws IllegalArgumentException
runTask
in interface org.bukkit.scheduler.BukkitScheduler
IllegalArgumentException
@Deprecated public org.bukkit.scheduler.BukkitTask runTask(org.bukkit.plugin.Plugin plugin, org.bukkit.scheduler.BukkitRunnable task) throws IllegalArgumentException
runTask
in interface org.bukkit.scheduler.BukkitScheduler
IllegalArgumentException
public org.bukkit.scheduler.BukkitTask runTaskAsynchronously(org.bukkit.plugin.Plugin plugin, Runnable task) throws IllegalArgumentException
runTaskAsynchronously
in interface org.bukkit.scheduler.BukkitScheduler
IllegalArgumentException
@Deprecated public org.bukkit.scheduler.BukkitTask runTaskAsynchronously(org.bukkit.plugin.Plugin plugin, org.bukkit.scheduler.BukkitRunnable task) throws IllegalArgumentException
runTaskAsynchronously
in interface org.bukkit.scheduler.BukkitScheduler
IllegalArgumentException
public org.bukkit.scheduler.BukkitTask runTaskLater(org.bukkit.plugin.Plugin plugin, Runnable task, long delay) throws IllegalArgumentException
runTaskLater
in interface org.bukkit.scheduler.BukkitScheduler
IllegalArgumentException
@Deprecated public org.bukkit.scheduler.BukkitTask runTaskLater(org.bukkit.plugin.Plugin plugin, org.bukkit.scheduler.BukkitRunnable task, long delay) throws IllegalArgumentException
runTaskLater
in interface org.bukkit.scheduler.BukkitScheduler
IllegalArgumentException
public org.bukkit.scheduler.BukkitTask runTaskLaterAsynchronously(org.bukkit.plugin.Plugin plugin, Runnable task, long delay) throws IllegalArgumentException
runTaskLaterAsynchronously
in interface org.bukkit.scheduler.BukkitScheduler
IllegalArgumentException
@Deprecated public org.bukkit.scheduler.BukkitTask runTaskLaterAsynchronously(org.bukkit.plugin.Plugin plugin, org.bukkit.scheduler.BukkitRunnable task, long delay) throws IllegalArgumentException
runTaskLaterAsynchronously
in interface org.bukkit.scheduler.BukkitScheduler
IllegalArgumentException
public org.bukkit.scheduler.BukkitTask runTaskTimer(org.bukkit.plugin.Plugin plugin, Runnable task, long delay, long period) throws IllegalArgumentException
runTaskTimer
in interface org.bukkit.scheduler.BukkitScheduler
IllegalArgumentException
@Deprecated public org.bukkit.scheduler.BukkitTask runTaskTimer(org.bukkit.plugin.Plugin plugin, org.bukkit.scheduler.BukkitRunnable task, long delay, long period) throws IllegalArgumentException
runTaskTimer
in interface org.bukkit.scheduler.BukkitScheduler
IllegalArgumentException
public org.bukkit.scheduler.BukkitTask runTaskTimerAsynchronously(org.bukkit.plugin.Plugin plugin, Runnable task, long delay, long period) throws IllegalArgumentException
runTaskTimerAsynchronously
in interface org.bukkit.scheduler.BukkitScheduler
IllegalArgumentException
@Deprecated public org.bukkit.scheduler.BukkitTask runTaskTimerAsynchronously(org.bukkit.plugin.Plugin plugin, org.bukkit.scheduler.BukkitRunnable task, long delay, long period) throws IllegalArgumentException
runTaskTimerAsynchronously
in interface org.bukkit.scheduler.BukkitScheduler
IllegalArgumentException
public <T> Future<T> callSyncMethod(org.bukkit.plugin.Plugin plugin, Callable<T> task)
callSyncMethod
in interface org.bukkit.scheduler.BukkitScheduler
public <T> T syncIfNeeded(Callable<T> task) throws Exception
T
- the task's return typetask
- the task to runException
- if thrown by the taskpublic void cancelTask(int taskId)
cancelTask
in interface org.bukkit.scheduler.BukkitScheduler
public void cancelTasks(org.bukkit.plugin.Plugin plugin)
cancelTasks
in interface org.bukkit.scheduler.BukkitScheduler
public void cancelAllTasks()
cancelAllTasks
in interface org.bukkit.scheduler.BukkitScheduler
public boolean isCurrentlyRunning(int taskId)
isCurrentlyRunning
in interface org.bukkit.scheduler.BukkitScheduler
public boolean isQueued(int taskId)
isQueued
in interface org.bukkit.scheduler.BukkitScheduler
public List<org.bukkit.scheduler.BukkitWorker> getActiveWorkers()
getActiveWorkers
in interface org.bukkit.scheduler.BukkitScheduler
public List<org.bukkit.scheduler.BukkitTask> getPendingTasks()
getPendingTasks
in interface org.bukkit.scheduler.BukkitScheduler
Copyright © 2021. All rights reserved.