public class ScheduledTask
extends java.lang.Object
implements org.bukkit.scheduler.BukkitTask
| Constructor and Description |
|---|
ScheduledTask(int id,
org.bukkit.plugin.Plugin plugin,
boolean isSync,
long scheduledTick,
java.lang.Runnable runnable) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOnCancelled(java.lang.Runnable callback)
Adds a callback which is executed when the task is cancelled.
|
void |
cancel() |
org.bukkit.plugin.Plugin |
getOwner() |
java.lang.Runnable |
getRunnable()
Get the task itself that will be ran.
|
long |
getScheduledTick()
Get the tick at which the task is scheduled to run at.
|
int |
getTaskId() |
boolean |
isCancelled() |
boolean |
isRunning() |
boolean |
isSync() |
void |
run()
Runs the task if it has not been cancelled.
|
void |
setRunning(boolean running) |
protected void |
setScheduledTick(long scheduledTick)
Sets the tick at which the task is scheduled to run at.
|
public ScheduledTask(int id,
org.bukkit.plugin.Plugin plugin,
boolean isSync,
long scheduledTick,
java.lang.Runnable runnable)
public boolean isRunning()
public void setRunning(boolean running)
public long getScheduledTick()
protected void setScheduledTick(long scheduledTick)
scheduledTick - The tick at which the task is scheduled to run at.public java.lang.Runnable getRunnable()
public void run()
public int getTaskId()
getTaskId in interface org.bukkit.scheduler.BukkitTaskpublic org.bukkit.plugin.Plugin getOwner()
getOwner in interface org.bukkit.scheduler.BukkitTaskpublic boolean isSync()
isSync in interface org.bukkit.scheduler.BukkitTaskpublic boolean isCancelled()
isCancelled in interface org.bukkit.scheduler.BukkitTaskpublic void cancel()
cancel in interface org.bukkit.scheduler.BukkitTaskpublic void addOnCancelled(java.lang.Runnable callback)
callback - The callback which gets executed when the task is cancelled.