Class Schedulers

java.lang.Object
dev.demeng.pluginbase.Schedulers

public final class Schedulers extends Object
Provides common instances of Scheduler.
  • Constructor Details

    • Schedulers

      public Schedulers()
  • Method Details

    • get

      @NotNull public static @NotNull Scheduler get(ThreadContext context)
      Gets a scheduler for the given context.
      Parameters:
      context - the context
      Returns:
      a scheduler
    • sync

      @NotNull public static @NotNull Scheduler sync()
      Returns a "sync" scheduler, which executes tasks on the main server thread.
      Returns:
      a sync executor instance
    • async

      @NotNull public static @NotNull Scheduler async()
      Returns an "async" scheduler, which executes tasks asynchronously.
      Returns:
      an async executor instance
    • bukkit

      @NotNull public static @NotNull org.bukkit.scheduler.BukkitScheduler bukkit()
      Gets Bukkit's scheduler.
      Returns:
      bukkit's scheduler
    • builder

      @NotNull public static @NotNull TaskBuilder builder()
      Gets a TaskBuilder instance
      Returns:
      a task builder