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 TypeMethodDescriptionvoid
cancelTasks
(@NotNull Plugin plugin) Attempts to cancel all tasks scheduled by the specified plugin.void
Schedules a task to be executed on the global region.Schedules a task to be executed on the global region on the next tick.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.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
Schedules a task to be executed on the global region.- Parameters:
plugin
- The plugin that owns the taskrun
- 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 tasktask
- 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 tasktask
- The task to executedelayTicks
- 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 tasktask
- The task to executeinitialDelayTicks
- The initial delay, in ticks.periodTicks
- The period, in ticks.- Returns:
- The
ScheduledTask
that represents the scheduled task.
-
cancelTasks
Attempts to cancel all tasks scheduled by the specified plugin.- Parameters:
plugin
- Specified plugin.
-