Class BukkitTask
java.lang.Object
io.github.projectunified.minelib.scheduler.common.util.task.BukkitTask
- All Implemented Interfaces:
Task
A wrapped
Task for a Bukkit task-
Constructor Summary
ConstructorsConstructorDescriptionBukkitTask(org.bukkit.scheduler.BukkitTask bukkitTask) Create a new instance ofBukkitTask -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancel the taskorg.bukkit.scheduler.BukkitTaskGet the original Bukkit taskorg.bukkit.plugin.PluginGet the plugin that owns the taskbooleanCheck if the task is cancelledbooleanisDone()Check if the task is donestatic org.bukkit.scheduler.BukkitRunnablewrapRunnable(BooleanSupplier runnable) Wrap aRunnableinto aBukkitRunnable
-
Constructor Details
-
BukkitTask
public BukkitTask(org.bukkit.scheduler.BukkitTask bukkitTask) Create a new instance ofBukkitTask- Parameters:
bukkitTask- the Bukkit task to wrap
-
-
Method Details
-
wrapRunnable
Wrap aRunnableinto aBukkitRunnable- Parameters:
runnable- the runnable to wrap- Returns:
- the wrapped runnable
-
getBukkitTask
public org.bukkit.scheduler.BukkitTask getBukkitTask()Get the original Bukkit task- Returns:
- The original Bukkit task
-
isCancelled
public boolean isCancelled()Description copied from interface:TaskCheck if the task is cancelled- Specified by:
isCancelledin interfaceTask- Returns:
- true if the task is cancelled
-
isDone
public boolean isDone()Description copied from interface:TaskCheck if the task is done -
cancel
public void cancel()Description copied from interface:TaskCancel the task -
getPlugin
public org.bukkit.plugin.Plugin getPlugin()Description copied from interface:TaskGet the plugin that owns the task
-