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 Summary

    Modifier and Type
    Method
    Description
    void
    cancelTasks(@NotNull Plugin plugin)
    Attempts to cancel all tasks scheduled by the specified plugin.
    void
    execute(@NotNull Plugin plugin, @NotNull Runnable run)
    Schedules a task to be executed on the global region.
    @NotNull ScheduledTask
    run(@NotNull Plugin plugin, @NotNull Consumer<ScheduledTask> task)
    Schedules a task to be executed on the global region on the next tick.
    @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.
    @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.
  • Method Details

    • execute

      void execute(@NotNull @NotNull Plugin plugin, @NotNull @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

      @NotNull @NotNull ScheduledTask run(@NotNull @NotNull Plugin plugin, @NotNull @NotNull Consumer<ScheduledTask> task)
      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 @NotNull ScheduledTask runDelayed(@NotNull @NotNull Plugin plugin, @NotNull @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 @NotNull ScheduledTask runAtFixedRate(@NotNull @NotNull Plugin plugin, @NotNull @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 @NotNull Plugin plugin)
      Attempts to cancel all tasks scheduled by the specified plugin.
      Parameters:
      plugin - Specified plugin.