java.lang.Object
io.github.projectunified.minelib.scheduler.common.util.task.BukkitTask
All Implemented Interfaces:
Task

public class BukkitTask extends Object implements Task
A wrapped Task for a Bukkit task
  • Constructor Details

    • BukkitTask

      public BukkitTask(org.bukkit.scheduler.BukkitTask bukkitTask)
      Create a new instance of BukkitTask
      Parameters:
      bukkitTask - the Bukkit task to wrap
  • Method Details

    • wrapRunnable

      public static org.bukkit.scheduler.BukkitRunnable wrapRunnable(BooleanSupplier runnable)
      Wrap a Runnable into a BukkitRunnable
      Parameters:
      runnable - the runnable to wrap
      Returns:
      the wrapped runnable
    • getBukkitTask

      public org.bukkit.scheduler.BukkitTask getBukkitTask()
      Get the original Bukkit task
      Returns:
      The original Bukkit task
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Task
      Check if the task is cancelled
      Specified by:
      isCancelled in interface Task
      Returns:
      true if the task is cancelled
    • isDone

      public boolean isDone()
      Description copied from interface: Task
      Check if the task is done
      Specified by:
      isDone in interface Task
      Returns:
      true if the task is done
    • cancel

      public void cancel()
      Description copied from interface: Task
      Cancel the task
      Specified by:
      cancel in interface Task
    • getPlugin

      public org.bukkit.plugin.Plugin getPlugin()
      Description copied from interface: Task
      Get the plugin that owns the task
      Specified by:
      getPlugin in interface Task
      Returns:
      the plugin