java.lang.Runnable
public abstract class BukkitRunnable
extends java.lang.Object
implements java.lang.Runnable
Constructor | Description |
---|---|
BukkitRunnable() |
Modifier and Type | Method | Description |
---|---|---|
void |
cancel() |
Attempts to cancel this task.
|
int |
getTaskId() |
Gets the task id for this runnable.
|
boolean |
isCancelled() |
Returns true if this task has been cancelled.
|
BukkitTask |
runTask(Plugin plugin) |
Schedules this in the Bukkit scheduler to run on next tick.
|
BukkitTask |
runTaskAsynchronously(Plugin plugin) |
Asynchronous tasks should never access any API in Bukkit.
|
BukkitTask |
runTaskLater(Plugin plugin,
long delay) |
Schedules this to run after the specified number of server ticks.
|
BukkitTask |
runTaskLaterAsynchronously(Plugin plugin,
long delay) |
Asynchronous tasks should never access any API in Bukkit.
|
BukkitTask |
runTaskTimer(Plugin plugin,
long delay,
long period) |
Schedules this to repeatedly run until cancelled, starting after the
specified number of server ticks.
|
BukkitTask |
runTaskTimerAsynchronously(Plugin plugin,
long delay,
long period) |
Asynchronous tasks should never access any API in Bukkit.
|
public boolean isCancelled() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if task was not scheduled yetpublic void cancel() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if task was not scheduled yetpublic BukkitTask runTask(Plugin plugin) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
plugin
- the reference to the plugin scheduling taskjava.lang.IllegalArgumentException
- if plugin is nulljava.lang.IllegalStateException
- if this was already scheduledBukkitScheduler.runTask(Plugin, Runnable)
public BukkitTask runTaskAsynchronously(Plugin plugin) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
Schedules this in the Bukkit scheduler to run asynchronously.
plugin
- the reference to the plugin scheduling taskjava.lang.IllegalArgumentException
- if plugin is nulljava.lang.IllegalStateException
- if this was already scheduledBukkitScheduler.runTaskAsynchronously(Plugin, Runnable)
public BukkitTask runTaskLater(Plugin plugin, long delay) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
plugin
- the reference to the plugin scheduling taskdelay
- the ticks to wait before running the taskjava.lang.IllegalArgumentException
- if plugin is nulljava.lang.IllegalStateException
- if this was already scheduledBukkitScheduler.runTaskLater(Plugin, Runnable, long)
public BukkitTask runTaskLaterAsynchronously(Plugin plugin, long delay) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
Schedules this to run asynchronously after the specified number of server ticks.
plugin
- the reference to the plugin scheduling taskdelay
- the ticks to wait before running the taskjava.lang.IllegalArgumentException
- if plugin is nulljava.lang.IllegalStateException
- if this was already scheduledBukkitScheduler.runTaskLaterAsynchronously(Plugin, Runnable, long)
public BukkitTask runTaskTimer(Plugin plugin, long delay, long period) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
plugin
- the reference to the plugin scheduling taskdelay
- the ticks to wait before running the taskperiod
- the ticks to wait between runsjava.lang.IllegalArgumentException
- if plugin is nulljava.lang.IllegalStateException
- if this was already scheduledBukkitScheduler.runTaskTimer(Plugin, Runnable, long, long)
public BukkitTask runTaskTimerAsynchronously(Plugin plugin, long delay, long period) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
Schedules this to repeatedly run asynchronously until cancelled, starting after the specified number of server ticks.
plugin
- the reference to the plugin scheduling taskdelay
- the ticks to wait before running the task for the first
timeperiod
- the ticks to wait between runsjava.lang.IllegalArgumentException
- if plugin is nulljava.lang.IllegalStateException
- if this was already scheduledBukkitScheduler.runTaskTimerAsynchronously(Plugin, Runnable, long,
long)
public int getTaskId() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if task was not scheduled yetCopyright © 2018. All rights reserved.