Interface Scheduler


public interface Scheduler
Represents a scheduler for executing tasks.
  • Method Details

    • runTask

      boolean runTask(Object plugin, Runnable runnable) throws IllegalArgumentException
      Schedules a task to run on next tick.
      Parameters:
      plugin - The reference to the plugin scheduling task
      runnable - The runnable to execute
      Returns:
      true if success, false if not
      Throws:
      IllegalArgumentException
    • runTask

      boolean runTask(Object plugin, Object sender, Runnable runnable) throws IllegalArgumentException
      Schedules a task to run on next tick.
      Parameters:
      plugin - The reference to the plugin scheduling task
      sender - The command sender
      runnable - The runnable to execute
      Returns:
      true if success, false if not
      Throws:
      IllegalArgumentException
    • runTaskAsynchronously

      Task runTaskAsynchronously(Object plugin, Runnable runnable) throws IllegalArgumentException
      Schedules a task to run on next tick asynchronously.
      Parameters:
      plugin - The reference to the plugin scheduling task
      runnable - The runnable to execute
      Returns:
      The scheduled task
      Throws:
      IllegalArgumentException
    • runTaskAsynchronously

      Task runTaskAsynchronously(Object plugin, Object sender, Runnable runnable) throws IllegalArgumentException
      Schedules a task to run on next tick asynchronously.
      Parameters:
      plugin - The reference to the plugin scheduling task
      sender - The command sender
      runnable - The runnable to execute
      Returns:
      The scheduled task
      Throws:
      IllegalArgumentException
    • runTaskLater

      Task runTaskLater(Object plugin, Runnable runnable, long delay) throws IllegalArgumentException
      Schedules a task that will run after the specified number of ticks.
      Parameters:
      plugin - the reference to the plugin scheduling task
      runnable - The runnable to execute
      delay - the ticks to wait before running the task
      Returns:
      The scheduled task
      Throws:
      IllegalArgumentException
    • runTaskLater

      Task runTaskLater(Object plugin, Object sender, Runnable runnable, long delay) throws IllegalArgumentException
      Schedules a task that will run after the specified number of ticks.
      Parameters:
      plugin - The reference to the plugin scheduling task
      sender - The command sender
      runnable - The runnable to execute
      delay - The ticks to wait before running the task
      Returns:
      The scheduled task
      Throws:
      IllegalArgumentException
    • runTaskLaterAsynchronously

      Task runTaskLaterAsynchronously(Object plugin, Runnable runnable, long delay) throws IllegalArgumentException
      Schedules a task that will run asynchronously after the specified number of ticks.
      Parameters:
      plugin - The reference to the plugin scheduling task
      runnable - The runnable to execute
      delay - The ticks to wait before running the task
      Returns:
      The scheduled task
      Throws:
      IllegalArgumentException
    • runTaskLaterAsynchronously

      Task runTaskLaterAsynchronously(Object plugin, Object sender, Runnable runnable, long delay) throws IllegalArgumentException
      Schedules a task that will run asynchronously after the specified number of ticks.
      Parameters:
      plugin - The reference to the plugin scheduling task
      sender - The command sender
      runnable - The runnable to execute
      delay - The ticks to wait before running the task
      Returns:
      The scheduled task
      Throws:
      IllegalArgumentException
    • runTaskTimer

      Task runTaskTimer(Object plugin, Runnable runnable, long delay, long period) throws IllegalArgumentException
      Schedules a repeating task that will run until cancelled, starting after the specified number of server ticks.
      Parameters:
      plugin - The reference to the plugin scheduling task
      runnable - The runnable to execute
      delay - The ticks to wait before running the task
      period - The ticks to wait between runs
      Throws:
      IllegalArgumentException
    • runTaskTimer

      Task runTaskTimer(Object plugin, Object sender, Runnable runnable, long delay, long period) throws IllegalArgumentException
      Schedules a repeating task that will run until cancelled, starting after the specified number of server ticks.
      Parameters:
      plugin - The reference to the plugin scheduling task
      sender - The command sender
      runnable - The runnable to execute
      delay - The ticks to wait before running the task
      period - The ticks to wait between runs
      Throws:
      IllegalArgumentException