Class GlobalRegionScheduler

java.lang.Object
io.github.retrooper.packetevents.util.folia.GlobalRegionScheduler

public class GlobalRegionScheduler extends Object
Represents a scheduler for executing global region tasks.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    cancel(@NotNull org.bukkit.plugin.Plugin plugin)
    Attempts to cancel all tasks scheduled by the specified plugin.
    void
    execute(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull Runnable run)
    Schedules a task to be executed on the global region.
    run(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull Consumer<Object> task)
    Schedules a task to be executed on the global region.
    runAtFixedRate(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull Consumer<Object> 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 org.bukkit.plugin.Plugin plugin, @NotNull Consumer<Object> task, long delay)
    Schedules a task to be executed on the global region after the specified delay in ticks.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GlobalRegionScheduler

      protected GlobalRegionScheduler()
  • Method Details

    • execute

      public void execute(@NotNull @NotNull org.bukkit.plugin.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

      public TaskWrapper run(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull Consumer<Object> task)
      Schedules a task to be executed on the global region.
      Parameters:
      plugin - The plugin that owns the task
      task - The task to execute
      Returns:
      TaskWrapper instance representing a wrapped task
    • runDelayed

      public TaskWrapper runDelayed(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull Consumer<Object> task, long delay)
      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
      delay - The delay, in ticks before the method is invoked. Any value less-than 1 is treated as 1.
      Returns:
      TaskWrapper instance representing a wrapped task
    • runAtFixedRate

      public TaskWrapper runAtFixedRate(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull Consumer<Object> 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 before the method is invoked. Any value less-than 1 is treated as 1.
      periodTicks - The period, in ticks. Any value less-than 1 is treated as 1.
      Returns:
      TaskWrapper instance representing a wrapped task
    • cancel

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