Package net.lapismc.lapiscore.utils
Class LapisTaskHandler
- java.lang.Object
-
- net.lapismc.lapiscore.utils.LapisTaskHandler
-
public class LapisTaskHandler extends java.lang.ObjectA class for storing BukkitTasks so that they can be cleanly canceled when the plugin disables
-
-
Constructor Summary
Constructors Constructor Description LapisTaskHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddShutdownTask(java.lang.Runnable task)Adds a task to be run when the plugin is disabledvoidaddTask(org.bukkit.scheduler.BukkitTask task)Add a task so that it can be canceled latervoidremoveTask(org.bukkit.scheduler.BukkitTask task)Remove a task, this should be used if you manually cancel a taskvoidstopALlTasks()Should only be called from on disable as it will cancel all registered commands
-
-
-
Method Detail
-
addTask
public void addTask(org.bukkit.scheduler.BukkitTask task)
Add a task so that it can be canceled later- Parameters:
task- The task to register
-
removeTask
public void removeTask(org.bukkit.scheduler.BukkitTask task)
Remove a task, this should be used if you manually cancel a task- Parameters:
task- The task to remove
-
addShutdownTask
public void addShutdownTask(java.lang.Runnable task)
Adds a task to be run when the plugin is disabled- Parameters:
task- The Runnable to run
-
stopALlTasks
public void stopALlTasks()
Should only be called from on disable as it will cancel all registered commands
-
-