public abstract class Task extends Object implements Runnable
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 and Description |
|---|
Task() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
TaskHandler |
getHandler() |
int |
getTaskId() |
void |
onCancel() |
abstract void |
onRun(int currentTick)
The method called when a task is executed.
|
void |
run() |
void |
setHandler(TaskHandler taskHandler) |
public final TaskHandler getHandler()
public final int getTaskId()
public final void setHandler(TaskHandler taskHandler)
public abstract void onRun(int currentTick)
currentTick - The elapsed tick count from the server is started.
20 ticks = 1 second, 1 tick = 0.05 secondspublic void onCancel()
public void cancel()
Copyright © 2020. All rights reserved.