Class Tasks

java.lang.Object
com.welcome234.pluginsystem.Tasks

public class Tasks extends Object
This class is used for managing the TaskScheduler
  • Method Details

    • getRunningTasks

      public static ArrayList<TaskScheduler> getRunningTasks()
      Gets all currently running tasks, including all other plugins
      Returns:
      Array list of TaskScheduler currently running
    • cancelTasks

      public static void cancelTasks(PluginJava plugin)
      Cancels all tasks for the specified plugin instance
      Parameters:
      plugin - Plugin instance
    • getByID

      public static TaskScheduler getByID(int id)
      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

      public static PluginJava getOwner(int id)
      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