Interface GlobalRegionScheduler


public interface GlobalRegionScheduler
The global region task scheduler may be used to schedule tasks that will execute on the global region.

The global region is responsible for maintaining world day time, world game time, weather cycle, sleep night skipping, executing commands for console, and other misc. tasks that do not belong to any specific region.

  • Method Details

    • execute

      void execute(@NotNull Plugin plugin, @NotNull Runnable run)
      Schedules a task to be executed on the global region.
      Parameters:
      plugin - The plugin that owns the task
      run - The task to execute
    • run

      Schedules a task to be executed on the global region on the next tick.
      Parameters:
      plugin - The plugin that owns the task
      task - The task to execute
      Returns:
      The ScheduledTask that represents the scheduled task.
    • runDelayed

      @NotNull ScheduledTask runDelayed(@NotNull Plugin plugin, @NotNull Consumer<ScheduledTask> task, long delayTicks)
      Schedules a task to be executed on the global region after the specified delay in ticks.
      Parameters:
      plugin - The plugin that owns the task
      task - The task to execute
      delayTicks - The delay, in ticks.
      Returns:
      The ScheduledTask that represents the scheduled task.
    • runAtFixedRate

      @NotNull ScheduledTask runAtFixedRate(@NotNull Plugin plugin, @NotNull Consumer<ScheduledTask> task, long initialDelayTicks, long periodTicks)
      Schedules a repeating task to be executed on the global region after the initial delay with the specified period.
      Parameters:
      plugin - The plugin that owns the task
      task - The task to execute
      initialDelayTicks - The initial delay, in ticks.
      periodTicks - The period, in ticks.
      Returns:
      The ScheduledTask that represents the scheduled task.
    • cancelTasks

      void cancelTasks(@NotNull Plugin plugin)
      Attempts to cancel all tasks scheduled by the specified plugin.
      Parameters:
      plugin - Specified plugin.