Constructor and Description |
---|
BukkitRunnable() |
Modifier and Type | Method and 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.
|
@NotNull BukkitTask |
runTask(@NotNull Plugin plugin)
Schedules this in the Bukkit scheduler to run on next tick.
|
@NotNull BukkitTask |
runTaskAsynchronously(@NotNull Plugin plugin)
Asynchronous tasks should never access any API in Bukkit.
|
@NotNull BukkitTask |
runTaskLater(@NotNull Plugin plugin,
long delay)
Schedules this to run after the specified number of server ticks.
|
@NotNull BukkitTask |
runTaskLaterAsynchronously(@NotNull Plugin plugin,
long delay)
Asynchronous tasks should never access any API in Bukkit.
|
@NotNull BukkitTask |
runTaskTimer(@NotNull Plugin plugin,
long delay,
long period)
Schedules this to repeatedly run until cancelled, starting after the
specified number of server ticks.
|
@NotNull BukkitTask |
runTaskTimerAsynchronously(@NotNull Plugin plugin,
long delay,
long period)
Asynchronous tasks should never access any API in Bukkit.
|
public boolean isCancelled() throws IllegalStateException
IllegalStateException
- if task was not scheduled yetpublic void cancel() throws IllegalStateException
IllegalStateException
- if task was not scheduled yet@NotNull public @NotNull BukkitTask runTask(@NotNull @NotNull Plugin plugin) throws IllegalArgumentException, IllegalStateException
plugin
- the reference to the plugin scheduling taskIllegalArgumentException
- if plugin is nullIllegalStateException
- if this was already scheduledBukkitScheduler.runTask(Plugin, Runnable)
@NotNull public @NotNull BukkitTask runTaskAsynchronously(@NotNull @NotNull Plugin plugin) throws IllegalArgumentException, IllegalStateException
Schedules this in the Bukkit scheduler to run asynchronously.
plugin
- the reference to the plugin scheduling taskIllegalArgumentException
- if plugin is nullIllegalStateException
- if this was already scheduledBukkitScheduler.runTaskAsynchronously(Plugin, Runnable)
@NotNull public @NotNull BukkitTask runTaskLater(@NotNull @NotNull Plugin plugin, long delay) throws IllegalArgumentException, IllegalStateException
plugin
- the reference to the plugin scheduling taskdelay
- the ticks to wait before running the taskIllegalArgumentException
- if plugin is nullIllegalStateException
- if this was already scheduledBukkitScheduler.runTaskLater(Plugin, Runnable, long)
@NotNull public @NotNull BukkitTask runTaskLaterAsynchronously(@NotNull @NotNull Plugin plugin, long delay) throws IllegalArgumentException, 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 taskIllegalArgumentException
- if plugin is nullIllegalStateException
- if this was already scheduledBukkitScheduler.runTaskLaterAsynchronously(Plugin, Runnable, long)
@NotNull public @NotNull BukkitTask runTaskTimer(@NotNull @NotNull Plugin plugin, long delay, long period) throws IllegalArgumentException, IllegalStateException
plugin
- the reference to the plugin scheduling taskdelay
- the ticks to wait before running the taskperiod
- the ticks to wait between runsIllegalArgumentException
- if plugin is nullIllegalStateException
- if this was already scheduledBukkitScheduler.runTaskTimer(Plugin, Runnable, long, long)
@NotNull public @NotNull BukkitTask runTaskTimerAsynchronously(@NotNull @NotNull Plugin plugin, long delay, long period) throws IllegalArgumentException, 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 runsIllegalArgumentException
- if plugin is nullIllegalStateException
- if this was already scheduledBukkitScheduler.runTaskTimerAsynchronously(Plugin, Runnable, long,
long)
public int getTaskId() throws IllegalStateException
IllegalStateException
- if task was not scheduled yetCopyright © 2021. All rights reserved.