Class Task
java.lang.Object
org.cloudburstmc.server.scheduler.Task
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
PluginTask
Represents a task being executed by the
ServerScheduler.
For plugin developers: To make sure your task will only be executed in the case of safety
(such as: prevent this task from running if its owner plugin is disabled),
it's suggested to use PluginTask instead of extend this class.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()intvoidonCancel()abstract voidonRun(int currentTick)The method called when a task is executed.voidrun()voidsetHandler(TaskHandler taskHandler)
-
Constructor Details
-
Task
public Task()
-
-
Method Details
-
getHandler
-
getTaskId
public final int getTaskId() -
setHandler
-
onRun
public abstract void onRun(int currentTick)The method called when a task is executed.- Parameters:
currentTick- The elapsed tick count from the server is started. 20 ticks = 1 second, 1 tick = 0.05 seconds
-
run
public final void run() -
onCancel
public void onCancel() -
cancel
public void cancel()
-