Class ScheduledTask

java.lang.Object
be.seeseemelk.mockbukkit.scheduler.ScheduledTask
All Implemented Interfaces:
org.bukkit.scheduler.BukkitTask
Direct Known Subclasses:
RepeatingTask

public class ScheduledTask extends Object implements org.bukkit.scheduler.BukkitTask
  • Constructor Details

    • ScheduledTask

      public ScheduledTask(int id, org.bukkit.plugin.Plugin plugin, boolean isSync, long scheduledTick, Runnable runnable)
  • Method Details

    • isRunning

      public boolean isRunning()
    • setRunning

      public void setRunning(boolean running)
    • getScheduledTick

      public long getScheduledTick()
      Get the tick at which the task is scheduled to run at.
      Returns:
      The tick the task is scheduled to run at.
    • setScheduledTick

      protected void setScheduledTick(long scheduledTick)
      Sets the tick at which the task is scheduled to run at.
      Parameters:
      scheduledTick - The tick at which the task is scheduled to run at.
    • getRunnable

      public Runnable getRunnable()
      Get the task itself that will be ran.
      Returns:
      The task that will be ran.
    • run

      public void run()
      Runs the task if it has not been cancelled.
    • getTaskId

      public int getTaskId()
      Specified by:
      getTaskId in interface org.bukkit.scheduler.BukkitTask
    • getOwner

      public org.bukkit.plugin.Plugin getOwner()
      Specified by:
      getOwner in interface org.bukkit.scheduler.BukkitTask
    • isSync

      public boolean isSync()
      Specified by:
      isSync in interface org.bukkit.scheduler.BukkitTask
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.scheduler.BukkitTask
    • cancel

      public void cancel()
      Specified by:
      cancel in interface org.bukkit.scheduler.BukkitTask
    • addOnCancelled

      public void addOnCancelled(Runnable callback)
      Adds a callback which is executed when the task is cancelled.
      Parameters:
      callback - The callback which gets executed when the task is cancelled.