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
ConstructorDescriptionBukkitTask
(org.bukkit.scheduler.BukkitTask bukkitTask) Create a new instance ofBukkitTask
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancel the taskorg.bukkit.scheduler.BukkitTask
Get the original Bukkit taskorg.bukkit.plugin.Plugin
Get the plugin that owns the taskboolean
Check if the task is cancelledboolean
isDone()
Check if the task is donestatic org.bukkit.scheduler.BukkitRunnable
wrapRunnable
(BooleanSupplier runnable) Wrap aRunnable
into 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 aRunnable
into 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:Task
Check if the task is cancelled- Specified by:
isCancelled
in interfaceTask
- Returns:
- true if the task is cancelled
-
isDone
public boolean isDone()Description copied from interface:Task
Check if the task is done -
cancel
public void cancel()Description copied from interface:Task
Cancel the task -
getPlugin
public org.bukkit.plugin.Plugin getPlugin()Description copied from interface:Task
Get the plugin that owns the task
-