Interface Scheduler

All Known Implementing Classes:
BukkitScheduler, FoliaScheduler

public interface Scheduler
The scheduler
  • Method Details

    • plugin

      static Scheduler plugin(org.bukkit.plugin.Plugin plugin)
      Get the Scheduler for the given Plugin
      Parameters:
      plugin - the plugin
      Returns:
      the scheduler
    • plugin

      static <T extends org.bukkit.plugin.java.JavaPlugin> Scheduler plugin(Class<T> clazz)
      Get the Scheduler for the given JavaPlugin
      Type Parameters:
      T - the plugin type
      Parameters:
      clazz - the plugin class
      Returns:
      the scheduler
    • providingPlugin

      static Scheduler providingPlugin(Class<?> clazz)
      Get the Scheduler for the JavaPlugin that provides the class
      Parameters:
      clazz - the class
      Returns:
      the scheduler
    • current

      static Scheduler current()
      Get the Scheduler for the given JavaPlugin that provides the Scheduler class
      Returns:
      the scheduler
    • cancelAllTasks

      void cancelAllTasks()
      Cancel all tasks
    • async

      Runner async()
      Get the Runner for asynchronous tasks
      Returns:
      the Runner
    • sync

      Runner sync()
      Get the Runner for synchronous tasks
      Returns:
      the Runner
    • runner

      default Runner runner(boolean async)
      Get the Runner for the given type
      Parameters:
      async - the type
      Returns:
      the Runner