Class Scheduler

java.lang.Object
net.pl3x.map.core.scheduler.Scheduler

public class Scheduler extends Object
  • Constructor Details

    • Scheduler

      public Scheduler()
  • Method Details

    • tick

      public void tick()
      Tick this scheduler once every tick.
    • error

      protected void error(String message, Throwable t)
    • cancelAll

      public void cancelAll()
      Cancel all scheduled tasks.
    • addTask

      public void addTask(@NotNull @NotNull Task task)
      Add task to the scheduler.
      Parameters:
      task - Task to add
    • addTask

      public void addTask(int delay, @NotNull @NotNull Runnable runnable)
      Add task to the scheduler.
      Parameters:
      delay - Delay (in seconds) before task starts
      runnable - Task to add
    • addTask

      public void addTask(int delay, @NotNull @NotNull Runnable runnable, boolean ticks)
      Add task to the scheduler.
      Parameters:
      delay - Delay (in seconds or ticks) before task starts
      runnable - Task to add
      ticks - Set to true to pass the delay as ticks instead of seconds
    • addTask

      public void addTask(int delay, boolean repeat, @NotNull @NotNull Runnable runnable)
      Add task to the scheduler.
      Parameters:
      delay - Delay (in seconds) before task starts
      repeat - Whether this task should repeat
      runnable - Task to add
    • addTask

      public void addTask(int delay, boolean repeat, @NotNull @NotNull Runnable runnable, boolean ticks)
      Add task to the scheduler.
      Parameters:
      delay - Delay (in seconds or ticks) before task starts
      repeat - Whether this task should repeat
      runnable - Task to add
      ticks - Set to true to pass the delay as ticks instead of seconds