java.lang.Object
net.ME1312.SubServers.Client.Bukkit.Library.Compatibility.AgnosticScheduler

public abstract class AgnosticScheduler extends Object
Folia Regional Scheduling Compatibility Class
  • Field Details

    • async

      public static final AgnosticScheduler async
      Provides an asynchronous thread scheduler (in both folia and bukkit)
    • global

      public static final AgnosticScheduler global
      Provides the folia global region scheduler / bukkit main thread scheduler
  • Constructor Details

    • AgnosticScheduler

      public AgnosticScheduler()
  • Method Details

    • at

      public static AgnosticScheduler at(Block block)
      Provides a folia region scheduler / bukkit main thread scheduler
      Parameters:
      block - Block
      Returns:
      Platform-agnostic Scheduler
    • at

      public static AgnosticScheduler at(Location location)
      Provides a folia region scheduler / bukkit main thread scheduler
      Parameters:
      location - Block location
      Returns:
      Platform-agnostic Scheduler
    • at

      public static AgnosticScheduler at(World world, int x, int z)
      Provides a folia region scheduler / bukkit main thread scheduler
      Parameters:
      world - Block world
      x - Block x coordinate
      z - Block z coordinate
      Returns:
      Platform-agnostic Scheduler
    • atChunk

      public static AgnosticScheduler atChunk(Chunk chunk)
      Provides a folia region scheduler / bukkit main thread scheduler
      Parameters:
      chunk - Chunk
      Returns:
      Platform-agnostic Scheduler
    • atChunk

      public static AgnosticScheduler atChunk(World world, int cx, int cz)
      Provides a folia region scheduler / bukkit main thread scheduler
      Parameters:
      world - Chunk world
      cx - Chunk x coordinate
      cz - Chunk z coordinate
      Returns:
      Platform-agnostic Scheduler
    • following

      public static AgnosticScheduler following(Entity entity)
      Provides a folia entity scheduler / bukkit main thread scheduler
      Parameters:
      entity - Entity
      Returns:
      Platform-agnostic Scheduler
    • runs

      public abstract Runnable runs(Plugin plugin, Consumer<Runnable> task)
      Schedules a 1-time task that runs immediately
      Parameters:
      plugin - Plugin
      task - Task (consumes a task cancellation runnable)
      Returns:
      A Runnable that can currently be used to cancel the task
    • runs

      public abstract Runnable runs(Plugin plugin, Consumer<Runnable> task, long delay)
      Schedules a 1-time task that runs after a number of ticks
      Parameters:
      plugin - Plugin
      task - Task (consumes a task cancellation runnable)
      delay - Delay in ticks
      Returns:
      A Runnable that can currently be used to cancel the task
    • runs

      public Runnable runs(Plugin plugin, Consumer<Runnable> task, long delay, TimeUnit units)
      Schedules a 1-time task that runs after a number of timeunits
      Parameters:
      plugin - Plugin
      task - Task (consumes a task cancellation runnable)
      delay - Delay
      units - Time units
      Returns:
      A Runnable that can currently be used to cancel the task
    • repeats

      public Runnable repeats(Plugin plugin, Consumer<Runnable> task, long repeat)
      Schedules a repeating task that runs after a number of ticks
      Parameters:
      plugin - Plugin
      task - Task (consumes a task cancellation runnable)
      repeat - Repeat delay in ticks
      Returns:
      A Runnable that can currently be used to cancel the task
    • repeats

      public Runnable repeats(Plugin plugin, Consumer<Runnable> task, long repeat, TimeUnit units)
      Schedules a repeating task that runs after a number of timeunits
      Parameters:
      plugin - Plugin
      task - Task (consumes a task cancellation runnable)
      repeat - Repeat delay
      units - Time units
      Returns:
      A Runnable that can currently be used to cancel the task
    • repeats

      public abstract Runnable repeats(Plugin plugin, Consumer<Runnable> task, long delay, long repeat)
      Schedules a repeating task that runs after a number of ticks
      Parameters:
      plugin - Plugin
      task - Task (consumes a task cancellation runnable)
      delay - Initial delay in ticks
      repeat - Repeat delay in ticks
      Returns:
      A Runnable that can currently be used to cancel the task
    • repeats

      public Runnable repeats(Plugin plugin, Consumer<Runnable> task, long delay, long repeat, TimeUnit units)
      Schedules a repeating task that runs after a number of timeunits
      Parameters:
      plugin - Plugin
      task - Task (consumes a task cancellation runnable)
      delay - Initial delay
      repeat - Repeat delay
      units - Time units
      Returns:
      A Runnable that can currently be used to cancel the task