public class DelayedSingleTask
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
closed |
protected org.bukkit.plugin.Plugin |
plugin |
protected org.bukkit.scheduler.BukkitScheduler |
scheduler |
protected int |
taskID |
Constructor and Description |
---|
DelayedSingleTask(org.bukkit.plugin.Plugin plugin)
Create a single task scheduler.
|
DelayedSingleTask(org.bukkit.plugin.Plugin plugin,
org.bukkit.scheduler.BukkitScheduler scheduler)
Create a single task scheduler.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancel()
Cancel a future task from being executed.
|
void |
close()
Stop the current task and all future tasks scheduled by this instance.
|
protected void |
finalize() |
org.bukkit.plugin.Plugin |
getPlugin()
Retrieve the plugin this task belongs to.
|
int |
getTaskID()
Retrieve the raw task ID.
|
boolean |
isRunning()
Whether or not a future task is scheduled to be executed.
|
boolean |
schedule(long ticksDelay,
java.lang.Runnable task)
Schedule a single task for execution.
|
protected int taskID
protected org.bukkit.plugin.Plugin plugin
protected org.bukkit.scheduler.BukkitScheduler scheduler
protected boolean closed
public DelayedSingleTask(org.bukkit.plugin.Plugin plugin)
plugin
- - owner plugin.public DelayedSingleTask(org.bukkit.plugin.Plugin plugin, org.bukkit.scheduler.BukkitScheduler scheduler)
plugin
- - owner plugin.scheduler
- - specialized scheduler.public boolean schedule(long ticksDelay, java.lang.Runnable task)
Any previously scheduled task will be automatically cancelled.
Note that a tick delay of zero will execute the task immediately.
ticksDelay
- - number of ticks before the task is executed.task
- - the task to schedule.public boolean isRunning()
public boolean cancel()
public int getTaskID()
public org.bukkit.plugin.Plugin getPlugin()
public void close()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable