Package com.welcome234.pluginsystem
Class Tasks
java.lang.Object
com.welcome234.pluginsystem.Tasks
This class is used for managing the TaskScheduler
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcancelTask(int id)Cancels the task for the specified ID numberstatic voidcancelTasks(PluginJava plugin)Cancels all tasks for the specified plugin instancestatic TaskSchedulergetByID(int id)Gets the task for the specified ID numberstatic PluginJavagetOwner(int id)Gets the plugin that runs this task for the specified ID numberstatic ArrayList<TaskScheduler>Gets all currently running tasks, including all other pluginsstatic booleanisRunning(int id)Gets if the task is running for the specified ID number
-
Method Details
-
getRunningTasks
Gets all currently running tasks, including all other plugins- Returns:
- Array list of TaskScheduler currently running
-
cancelTasks
Cancels all tasks for the specified plugin instance- Parameters:
plugin- Plugin instance
-
getByID
Gets the task for the specified ID number- Parameters:
id- Task ID- Returns:
- TaskScheduler with this ID
- Throws:
IllegalArgumentException- if task is not running
-
cancelTask
public static void cancelTask(int id)Cancels the task for the specified ID number- Parameters:
id- Task ID- Throws:
IllegalArgumentException- if task is not running
-
isRunning
public static boolean isRunning(int id)Gets if the task is running for the specified ID number- Parameters:
id- Task ID- Returns:
- Whether task is running
-
getOwner
Gets the plugin that runs this task for the specified ID number- Parameters:
id- Task ID- Returns:
- Task owner plugin instance
- Throws:
IllegalArgumentException- if task is not running
-