|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BukkitScheduler
Method Summary | ||
---|---|---|
|
callSyncMethod(Plugin plugin,
Callable<T> task)
Calls a method on the main thread and returns a Future object. |
|
void |
cancelAllTasks()
Removes all tasks from the scheduler. |
|
void |
cancelTask(int taskId)
Removes task from scheduler. |
|
void |
cancelTasks(Plugin plugin)
Removes all tasks associated with a particular plugin from the scheduler. |
|
List<BukkitWorker> |
getActiveWorkers()
Returns a list of all active workers. |
|
List<BukkitTask> |
getPendingTasks()
Returns a list of all pending tasks. |
|
boolean |
isCurrentlyRunning(int taskId)
Check if the task currently running. |
|
boolean |
isQueued(int taskId)
Check if the task queued to be run later. |
|
BukkitTask |
runTask(Plugin plugin,
BukkitRunnable task)
Deprecated. Use BukkitRunnable.runTask(Plugin) |
|
BukkitTask |
runTask(Plugin plugin,
Runnable task)
Returns a task that will run on the next server tick. |
|
BukkitTask |
runTaskAsynchronously(Plugin plugin,
BukkitRunnable task)
Deprecated. Use BukkitRunnable.runTaskAsynchronously(Plugin) |
|
BukkitTask |
runTaskAsynchronously(Plugin plugin,
Runnable task)
Asynchronous tasks should never access any API in Bukkit. |
|
BukkitTask |
runTaskLater(Plugin plugin,
BukkitRunnable task,
long delay)
Deprecated. Use BukkitRunnable.runTaskLater(Plugin, long) |
|
BukkitTask |
runTaskLater(Plugin plugin,
Runnable task,
long delay)
Returns a task that will run after the specified number of server ticks. |
|
BukkitTask |
runTaskLaterAsynchronously(Plugin plugin,
BukkitRunnable task,
long delay)
Deprecated. Use BukkitRunnable.runTaskLaterAsynchronously(Plugin, long) |
|
BukkitTask |
runTaskLaterAsynchronously(Plugin plugin,
Runnable task,
long delay)
Asynchronous tasks should never access any API in Bukkit. |
|
BukkitTask |
runTaskTimer(Plugin plugin,
BukkitRunnable task,
long delay,
long period)
Deprecated. Use BukkitRunnable.runTaskTimer(Plugin, long, long) |
|
BukkitTask |
runTaskTimer(Plugin plugin,
Runnable task,
long delay,
long period)
Returns a task that will repeatedly run until cancelled, starting after the specified number of server ticks. |
|
BukkitTask |
runTaskTimerAsynchronously(Plugin plugin,
BukkitRunnable task,
long delay,
long period)
Deprecated. Use BukkitRunnable.runTaskTimerAsynchronously(Plugin, long, long) |
|
BukkitTask |
runTaskTimerAsynchronously(Plugin plugin,
Runnable task,
long delay,
long period)
Asynchronous tasks should never access any API in Bukkit. |
|
int |
scheduleAsyncDelayedTask(Plugin plugin,
Runnable task)
Deprecated. This name is misleading, as it does not schedule "a sync" task, but rather, "an async" task |
|
int |
scheduleAsyncDelayedTask(Plugin plugin,
Runnable task,
long delay)
Deprecated. This name is misleading, as it does not schedule "a sync" task, but rather, "an async" task |
|
int |
scheduleAsyncRepeatingTask(Plugin plugin,
Runnable task,
long delay,
long period)
Deprecated. This name is misleading, as it does not schedule "a sync" task, but rather, "an async" task |
|
int |
scheduleSyncDelayedTask(Plugin plugin,
BukkitRunnable task)
Deprecated. Use BukkitRunnable.runTask(Plugin) |
|
int |
scheduleSyncDelayedTask(Plugin plugin,
BukkitRunnable task,
long delay)
Deprecated. Use BukkitRunnable.runTaskLater(Plugin, long) |
|
int |
scheduleSyncDelayedTask(Plugin plugin,
Runnable task)
Schedules a once off task to occur as soon as possible. |
|
int |
scheduleSyncDelayedTask(Plugin plugin,
Runnable task,
long delay)
Schedules a once off task to occur after a delay. |
|
int |
scheduleSyncRepeatingTask(Plugin plugin,
BukkitRunnable task,
long delay,
long period)
Deprecated. Use BukkitRunnable.runTaskTimer(Plugin, long, long) |
|
int |
scheduleSyncRepeatingTask(Plugin plugin,
Runnable task,
long delay,
long period)
Schedules a repeating task. |
Method Detail |
---|
int scheduleSyncDelayedTask(Plugin plugin, Runnable task, long delay)
This task will be executed by the main server thread.
plugin
- Plugin that owns the tasktask
- Task to be executeddelay
- Delay in server ticks before executing task
@Deprecated int scheduleSyncDelayedTask(Plugin plugin, BukkitRunnable task, long delay)
BukkitRunnable.runTaskLater(Plugin, long)
int scheduleSyncDelayedTask(Plugin plugin, Runnable task)
This task will be executed by the main server thread.
plugin
- Plugin that owns the tasktask
- Task to be executed
@Deprecated int scheduleSyncDelayedTask(Plugin plugin, BukkitRunnable task)
BukkitRunnable.runTask(Plugin)
int scheduleSyncRepeatingTask(Plugin plugin, Runnable task, long delay, long period)
This task will be executed by the main server thread.
plugin
- Plugin that owns the tasktask
- Task to be executeddelay
- Delay in server ticks before executing first repeatperiod
- Period in server ticks of the task
@Deprecated int scheduleSyncRepeatingTask(Plugin plugin, BukkitRunnable task, long delay, long period)
BukkitRunnable.runTaskTimer(Plugin, long, long)
@Deprecated int scheduleAsyncDelayedTask(Plugin plugin, Runnable task, long delay)
Schedules a once off task to occur after a delay. This task will be executed by a thread managed by the scheduler.
plugin
- Plugin that owns the tasktask
- Task to be executeddelay
- Delay in server ticks before executing task
@Deprecated int scheduleAsyncDelayedTask(Plugin plugin, Runnable task)
Schedules a once off task to occur as soon as possible. This task will be executed by a thread managed by the scheduler.
plugin
- Plugin that owns the tasktask
- Task to be executed
@Deprecated int scheduleAsyncRepeatingTask(Plugin plugin, Runnable task, long delay, long period)
Schedules a repeating task. This task will be executed by a thread managed by the scheduler.
plugin
- Plugin that owns the tasktask
- Task to be executeddelay
- Delay in server ticks before executing first repeatperiod
- Period in server ticks of the task
<T> Future<T> callSyncMethod(Plugin plugin, Callable<T> task)
T
- The callable's return typeplugin
- Plugin that owns the tasktask
- Task to be executed
void cancelTask(int taskId)
taskId
- Id number of task to be removedvoid cancelTasks(Plugin plugin)
plugin
- Owner of tasks to be removedvoid cancelAllTasks()
boolean isCurrentlyRunning(int taskId)
A repeating task might not be running currently, but will be running in the future. A task that has finished, and does not repeat, will not be running ever again.
Explicitly, a task is running if there exists a thread for it, and that thread is alive.
taskId
- The task to check.
boolean isQueued(int taskId)
If a repeating task is currently running, it might not be queued now but could be in the future. A task that is not queued, and not running, will not be queued again.
taskId
- The task to check.
List<BukkitWorker> getActiveWorkers()
This list contains asynch tasks that are being executed by separate threads.
List<BukkitTask> getPendingTasks()
BukkitTask runTask(Plugin plugin, Runnable task) throws IllegalArgumentException
plugin
- the reference to the plugin scheduling tasktask
- the task to be run
IllegalArgumentException
- if plugin is null
IllegalArgumentException
- if task is null@Deprecated BukkitTask runTask(Plugin plugin, BukkitRunnable task) throws IllegalArgumentException
BukkitRunnable.runTask(Plugin)
IllegalArgumentException
BukkitTask runTaskAsynchronously(Plugin plugin, Runnable task) throws IllegalArgumentException
Returns a task that will run asynchronously.
plugin
- the reference to the plugin scheduling tasktask
- the task to be run
IllegalArgumentException
- if plugin is null
IllegalArgumentException
- if task is null@Deprecated BukkitTask runTaskAsynchronously(Plugin plugin, BukkitRunnable task) throws IllegalArgumentException
BukkitRunnable.runTaskAsynchronously(Plugin)
IllegalArgumentException
BukkitTask runTaskLater(Plugin plugin, Runnable task, long delay) throws IllegalArgumentException
plugin
- the reference to the plugin scheduling tasktask
- the task to be rundelay
- the ticks to wait before running the task
IllegalArgumentException
- if plugin is null
IllegalArgumentException
- if task is null@Deprecated BukkitTask runTaskLater(Plugin plugin, BukkitRunnable task, long delay) throws IllegalArgumentException
BukkitRunnable.runTaskLater(Plugin, long)
IllegalArgumentException
BukkitTask runTaskLaterAsynchronously(Plugin plugin, Runnable task, long delay) throws IllegalArgumentException
Returns a task that will run asynchronously after the specified number of server ticks.
plugin
- the reference to the plugin scheduling tasktask
- the task to be rundelay
- the ticks to wait before running the task
IllegalArgumentException
- if plugin is null
IllegalArgumentException
- if task is null@Deprecated BukkitTask runTaskLaterAsynchronously(Plugin plugin, BukkitRunnable task, long delay) throws IllegalArgumentException
BukkitRunnable.runTaskLaterAsynchronously(Plugin, long)
IllegalArgumentException
BukkitTask runTaskTimer(Plugin plugin, Runnable task, long delay, long period) throws IllegalArgumentException
plugin
- the reference to the plugin scheduling tasktask
- the task to be rundelay
- the ticks to wait before running the taskperiod
- the ticks to wait between runs
IllegalArgumentException
- if plugin is null
IllegalArgumentException
- if task is null@Deprecated BukkitTask runTaskTimer(Plugin plugin, BukkitRunnable task, long delay, long period) throws IllegalArgumentException
BukkitRunnable.runTaskTimer(Plugin, long, long)
IllegalArgumentException
BukkitTask runTaskTimerAsynchronously(Plugin plugin, Runnable task, long delay, long period) throws IllegalArgumentException
Returns a task that will repeatedly run asynchronously until cancelled, starting after the specified number of server ticks.
plugin
- the reference to the plugin scheduling tasktask
- the task to be rundelay
- the ticks to wait before running the task for the first
timeperiod
- the ticks to wait between runs
IllegalArgumentException
- if plugin is null
IllegalArgumentException
- if task is null@Deprecated BukkitTask runTaskTimerAsynchronously(Plugin plugin, BukkitRunnable task, long delay, long period) throws IllegalArgumentException
BukkitRunnable.runTaskTimerAsynchronously(Plugin, long, long)
IllegalArgumentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |