![]() |
Bukkit
1.5.2-R1.0
|
Public Member Functions | |
| int | scheduleSyncDelayedTask (Plugin plugin, Runnable task, long delay) |
| Schedules a once off task to occur after a delay. | |
| int | scheduleSyncDelayedTask (Plugin plugin, Runnable task) |
| Schedules a once off task to occur as soon as possible. | |
| int | scheduleSyncRepeatingTask (Plugin plugin, Runnable task, long delay, long period) |
| Schedules a repeating task. | |
| int | scheduleAsyncDelayedTask (Plugin plugin, Runnable task, long delay) |
| Asynchronous tasks should never access any API in Bukkit. | |
| int | scheduleAsyncDelayedTask (Plugin plugin, Runnable task) |
| Asynchronous tasks should never access any API in Bukkit. | |
| int | scheduleAsyncRepeatingTask (Plugin plugin, Runnable task, long delay, long period) |
| Asynchronous tasks should never access any API in Bukkit. | |
| public< T > Future< T > | callSyncMethod (Plugin plugin, Callable< T > task) |
| Calls a method on the main thread and returns a Future object This task will be executed by the main server thread. | |
| void | cancelTask (int taskId) |
| Removes task from scheduler. | |
| void | cancelTasks (Plugin plugin) |
| Removes all tasks associated with a particular plugin from the scheduler. | |
| void | cancelAllTasks () |
| Removes all tasks from the scheduler. | |
| boolean | isCurrentlyRunning (int taskId) |
| Check if the task currently running. | |
| boolean | isQueued (int taskId) |
| Check if the task queued to be run later. | |
| List< BukkitWorker > | getActiveWorkers () |
| Returns a list of all active workers. | |
| List< BukkitTask > | getPendingTasks () |
| Returns a list of all pending tasks. | |
| BukkitTask | runTask (Plugin plugin, Runnable task) throws IllegalArgumentException |
| Returns a task that will run on the next server tick. | |
| BukkitTask | runTaskAsynchronously (Plugin plugin, Runnable task) throws IllegalArgumentException |
| Asynchronous tasks should never access any API in Bukkit. | |
| BukkitTask | runTaskLater (Plugin plugin, Runnable task, long delay) throws IllegalArgumentException |
| Returns a task that will run after the specified number of server ticks. | |
| BukkitTask | runTaskLaterAsynchronously (Plugin plugin, Runnable task, long delay) throws IllegalArgumentException |
| Asynchronous tasks should never access any API in Bukkit. | |
| BukkitTask | runTaskTimer (Plugin plugin, Runnable task, long delay, long period) throws IllegalArgumentException |
| Returns a task that will repeatedly run until cancelled, starting after the specified number of server ticks. | |
| BukkitTask | runTaskTimerAsynchronously (Plugin plugin, Runnable task, long delay, long period) throws IllegalArgumentException |
| Asynchronous tasks should never access any API in Bukkit. | |
Definition at line 8 of file BukkitScheduler.java.
| public<T> Future<T> org.bukkit.scheduler.BukkitScheduler.callSyncMethod | ( | Plugin | plugin, |
| Callable< T > | task | ||
| ) |
Calls a method on the main thread and returns a Future object This task will be executed by the main server thread.
Note: The Future.get() methods must NOT be called from the main thread. Note2: There is at least an average of 10ms latency until the isDone() method returns true.
| <T> | The callable's return type |
| plugin | Plugin that owns the task |
| task | Task to be executed |
| void org.bukkit.scheduler.BukkitScheduler.cancelAllTasks | ( | ) |
Removes all tasks from the scheduler.
| void org.bukkit.scheduler.BukkitScheduler.cancelTask | ( | int | taskId | ) |
Removes task from scheduler.
| taskId | Id number of task to be removed |
Referenced by org.bukkit.scheduler.BukkitRunnable.cancel().
| void org.bukkit.scheduler.BukkitScheduler.cancelTasks | ( | Plugin | plugin | ) |
Removes all tasks associated with a particular plugin from the scheduler.
| plugin | Owner of tasks to be removed |
Referenced by org.bukkit.plugin.SimplePluginManager.disablePlugin().
| List<BukkitWorker> org.bukkit.scheduler.BukkitScheduler.getActiveWorkers | ( | ) |
Returns a list of all active workers.
This list contains asynch tasks that are being executed by separate threads.
| List<BukkitTask> org.bukkit.scheduler.BukkitScheduler.getPendingTasks | ( | ) |
Returns a list of all pending tasks.
The ordering of the tasks is not related to their order of execution.
| boolean org.bukkit.scheduler.BukkitScheduler.isCurrentlyRunning | ( | int | taskId | ) |
Check if the task currently running.
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 org.bukkit.scheduler.BukkitScheduler.isQueued | ( | int | taskId | ) |
Check if the task queued to be run later.
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. |
| BukkitTask org.bukkit.scheduler.BukkitScheduler.runTask | ( | Plugin | plugin, |
| Runnable | task | ||
| ) | throws IllegalArgumentException |
Returns a task that will run on the next server tick.
| plugin | the reference to the plugin scheduling task |
| task | the task to be run |
| IllegalArgumentException | if plugin is null |
| IllegalArgumentException | if task is null |
Referenced by org.bukkit.scheduler.BukkitRunnable.runTask().
| BukkitTask org.bukkit.scheduler.BukkitScheduler.runTaskAsynchronously | ( | Plugin | plugin, |
| Runnable | task | ||
| ) | throws IllegalArgumentException |
Asynchronous tasks should never access any API in Bukkit.
Great care should be taken to assure the thread-safety of asynchronous tasks.
Returns a task that will run asynchronously.
| plugin | the reference to the plugin scheduling task |
| task | the task to be run |
| IllegalArgumentException | if plugin is null |
| IllegalArgumentException | if task is null |
Referenced by org.bukkit.scheduler.BukkitRunnable.runTaskAsynchronously().
| BukkitTask org.bukkit.scheduler.BukkitScheduler.runTaskLater | ( | Plugin | plugin, |
| Runnable | task, | ||
| long | delay | ||
| ) | throws IllegalArgumentException |
Returns a task that will run after the specified number of server ticks.
| plugin | the reference to the plugin scheduling task |
| task | the task to be run |
| delay | the ticks to wait before running the task |
| IllegalArgumentException | if plugin is null |
| IllegalArgumentException | if task is null |
Referenced by org.bukkit.scheduler.BukkitRunnable.runTaskLater().
| BukkitTask org.bukkit.scheduler.BukkitScheduler.runTaskLaterAsynchronously | ( | Plugin | plugin, |
| Runnable | task, | ||
| long | delay | ||
| ) | throws IllegalArgumentException |
Asynchronous tasks should never access any API in Bukkit.
Great care should be taken to assure the thread-safety of asynchronous tasks.
Returns a task that will run asynchronously after the specified number of server ticks.
| plugin | the reference to the plugin scheduling task |
| task | the task to be run |
| delay | the ticks to wait before running the task |
| IllegalArgumentException | if plugin is null |
| IllegalArgumentException | if task is null |
Referenced by org.bukkit.scheduler.BukkitRunnable.runTaskLaterAsynchronously().
| BukkitTask org.bukkit.scheduler.BukkitScheduler.runTaskTimer | ( | Plugin | plugin, |
| Runnable | task, | ||
| long | delay, | ||
| long | period | ||
| ) | throws IllegalArgumentException |
Returns a task that will repeatedly run until cancelled, starting after the specified number of server ticks.
| plugin | the reference to the plugin scheduling task |
| task | the task to be run |
| delay | the ticks to wait before running the task |
| period | the ticks to wait between runs |
| IllegalArgumentException | if plugin is null |
| IllegalArgumentException | if task is null |
Referenced by org.bukkit.scheduler.BukkitRunnable.runTaskTimer().
| BukkitTask org.bukkit.scheduler.BukkitScheduler.runTaskTimerAsynchronously | ( | Plugin | plugin, |
| Runnable | task, | ||
| long | delay, | ||
| long | period | ||
| ) | throws IllegalArgumentException |
Asynchronous tasks should never access any API in Bukkit.
Great care should be taken to assure the thread-safety of asynchronous tasks.
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 task |
| task | the task to be run |
| delay | the ticks to wait before running the task for the first time |
| period | the ticks to wait between runs |
| IllegalArgumentException | if plugin is null |
| IllegalArgumentException | if task is null |
Referenced by org.bukkit.scheduler.BukkitRunnable.runTaskTimerAsynchronously().
| int org.bukkit.scheduler.BukkitScheduler.scheduleAsyncDelayedTask | ( | Plugin | plugin, |
| Runnable | task, | ||
| long | delay | ||
| ) |
Asynchronous tasks should never access any API in Bukkit.
Great care should be taken to assure the thread-safety of asynchronous tasks.
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 task |
| task | Task to be executed |
| delay | Delay in server ticks before executing task |
| int org.bukkit.scheduler.BukkitScheduler.scheduleAsyncDelayedTask | ( | Plugin | plugin, |
| Runnable | task | ||
| ) |
Asynchronous tasks should never access any API in Bukkit.
Great care should be taken to assure the thread-safety of asynchronous tasks.
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 task |
| task | Task to be executed |
| int org.bukkit.scheduler.BukkitScheduler.scheduleAsyncRepeatingTask | ( | Plugin | plugin, |
| Runnable | task, | ||
| long | delay, | ||
| long | period | ||
| ) |
Asynchronous tasks should never access any API in Bukkit.
Great care should be taken to assure the thread-safety of asynchronous tasks.
Schedules a repeating task. This task will be executed by a thread managed by the scheduler.
| plugin | Plugin that owns the task |
| task | Task to be executed |
| delay | Delay in server ticks before executing first repeat |
| period | Period in server ticks of the task |
| int org.bukkit.scheduler.BukkitScheduler.scheduleSyncDelayedTask | ( | Plugin | plugin, |
| Runnable | task, | ||
| long | delay | ||
| ) |
Schedules a once off task to occur after a delay.
This task will be executed by the main server thread.
| plugin | Plugin that owns the task |
| task | Task to be executed |
| delay | Delay in server ticks before executing task |
Referenced by org.bukkit.permissions.PermissibleBase.addAttachment().
| int org.bukkit.scheduler.BukkitScheduler.scheduleSyncDelayedTask | ( | Plugin | plugin, |
| Runnable | task | ||
| ) |
Schedules a once off task to occur as soon as possible.
This task will be executed by the main server thread.
| plugin | Plugin that owns the task |
| task | Task to be executed |
| int org.bukkit.scheduler.BukkitScheduler.scheduleSyncRepeatingTask | ( | Plugin | plugin, |
| Runnable | task, | ||
| long | delay, | ||
| long | period | ||
| ) |
Schedules a repeating task.
This task will be executed by the main server thread.
| plugin | Plugin that owns the task |
| task | Task to be executed |
| delay | Delay in server ticks before executing first repeat |
| period | Period in server ticks of the task |