Class RegionScheduler
java.lang.Object
io.github.retrooper.packetevents.util.folia.RegionScheduler
Represents a scheduler for executing region tasks
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull org.bukkit.Location location, @NotNull Runnable run) Schedules a task to be executed on the region which owns the location.void
execute
(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull org.bukkit.World world, int chunkX, int chunkZ, @NotNull Runnable run) Schedules a task to be executed on the region which owns the location.run
(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull org.bukkit.Location location, @NotNull Consumer<Object> task) Schedules a task to be executed on the region which owns the location on the next tick.run
(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull org.bukkit.World world, int chunkX, int chunkZ, @NotNull Consumer<Object> task) Schedules a task to be executed on the region which owns the location on the next tick.runAtFixedRate
(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull org.bukkit.Location location, @NotNull Consumer<Object> task, long initialDelayTicks, long periodTicks) Schedules a repeating task to be executed on the region which owns the location after the initial delay with the specified period.runAtFixedRate
(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull org.bukkit.World world, int chunkX, int chunkZ, @NotNull Consumer<Object> task, long initialDelayTicks, long periodTicks) Schedules a repeating task to be executed on the region which owns the location after the initial delay with the specified period.runDelayed
(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull org.bukkit.Location location, @NotNull Consumer<Object> task, long delayTicks) Schedules a task to be executed on the region which owns the location after the specified delay in ticks.runDelayed
(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull org.bukkit.World world, int chunkX, int chunkZ, @NotNull Consumer<Object> task, long delayTicks) Schedules a task to be executed on the region which owns the location after the specified delay in ticks.
-
Constructor Details
-
RegionScheduler
protected RegionScheduler()
-
-
Method Details
-
execute
public void execute(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull org.bukkit.World world, int chunkX, int chunkZ, @NotNull @NotNull Runnable run) Schedules a task to be executed on the region which owns the location.- Parameters:
plugin
- The plugin that owns the taskworld
- The world of the region that owns the taskchunkX
- The chunk X coordinate of the region that owns the taskchunkZ
- The chunk Z coordinate of the region that owns the taskrun
- The task to execute
-
execute
public void execute(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull Runnable run) Schedules a task to be executed on the region which owns the location.- Parameters:
plugin
- The plugin that owns the tasklocation
- The location at which the region executing should ownrun
- The task to execute
-
run
public TaskWrapper run(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull org.bukkit.World world, int chunkX, int chunkZ, @NotNull @NotNull Consumer<Object> task) Schedules a task to be executed on the region which owns the location on the next tick.- Parameters:
plugin
- The plugin that owns the taskworld
- The world of the region that owns the taskchunkX
- The chunk X coordinate of the region that owns the taskchunkZ
- The chunk Z coordinate of the region that owns the tasktask
- The task to execute- Returns:
TaskWrapper
instance representing a wrapped task
-
run
public TaskWrapper run(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull Consumer<Object> task) Schedules a task to be executed on the region which owns the location on the next tick.- Parameters:
plugin
- The plugin that owns the tasklocation
- The location at which the region executing should owntask
- The task to execute- Returns:
TaskWrapper
instance representing a wrapped task
-
runDelayed
public TaskWrapper runDelayed(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull org.bukkit.World world, int chunkX, int chunkZ, @NotNull @NotNull Consumer<Object> task, long delayTicks) Schedules a task to be executed on the region which owns the location after the specified delay in ticks.- Parameters:
plugin
- The plugin that owns the taskworld
- The world of the region that owns the taskchunkX
- The chunk X coordinate of the region that owns the taskchunkZ
- The chunk Z coordinate of the region that owns the tasktask
- The task to executedelayTicks
- 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
-
runDelayed
public TaskWrapper runDelayed(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull Consumer<Object> task, long delayTicks) Schedules a task to be executed on the region which owns the location after the specified delay in ticks.- Parameters:
plugin
- The plugin that owns the tasklocation
- The location at which the region executing should owntask
- The task to executedelayTicks
- 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 org.bukkit.World world, int chunkX, int chunkZ, @NotNull @NotNull Consumer<Object> task, long initialDelayTicks, long periodTicks) Schedules a repeating task to be executed on the region which owns the location after the initial delay with the specified period.- Parameters:
plugin
- The plugin that owns the taskworld
- The world of the region that owns the taskchunkX
- The chunk X coordinate of the region that owns the taskchunkZ
- The chunk Z coordinate of the region that owns the tasktask
- The task to executeinitialDelayTicks
- 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
-
runAtFixedRate
public TaskWrapper runAtFixedRate(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull Consumer<Object> task, long initialDelayTicks, long periodTicks) Schedules a repeating task to be executed on the region which owns the location after the initial delay with the specified period.- Parameters:
plugin
- The plugin that owns the tasklocation
- The location at which the region executing should owntask
- The task to executeinitialDelayTicks
- 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
-