Interface SchedulerAdapter
- All Known Implementing Classes:
FoliaScheduler
,SpigotScheduler
public interface SchedulerAdapter
An abstraction layer for scheduling tasks across different Minecraft server implementations, such as Folia and
Spigot.
Allows seamless compatibility by abstracting scheduling methods.
-
Method Summary
Modifier and TypeMethodDescriptionrunEntityTask
(Entity entity, Runnable runnable) Executes a task specifically linked to an entity immediately.runEntityTaskLater
(Entity entity, Runnable runnable, long delayTicks) Executes a task specifically linked to an entity after a delay.runEntityTaskTimer
(Entity entity, Runnable runnable, long delayTicks, long periodTicks) Executes a repeating task specifically linked to an entity.runRegionTask
(Location location, Runnable runnable) Executes a task associated with a specific region or chunk.runRegionTask
(World world, int chunkX, int chunkZ, Runnable runnable) Executes a task associated with a specific region or chunk.runRegionTaskLater
(Location location, Runnable runnable, long delayTicks) Executes a task associated with a specific region or chunk after a delay.runRegionTaskLater
(World world, int chunkX, int chunkZ, Runnable runnable, long delayTicks) Executes a task associated with a specific region or chunk after a delay.runRegionTaskTimer
(Location location, Runnable runnable, long delayTicks, long periodTicks) Executes a repeating task associated with a specific region or chunk.runRegionTaskTimer
(World world, int chunkX, int chunkZ, Runnable runnable, long delayTicks, long periodTicks) Executes a repeating task associated with a specific region or chunk.Executes a task on the global server thread.runTaskAsynchronously
(Runnable runnable) Executes a task asynchronously immediately, off the main server thread.runTaskLater
(Runnable runnable, long delayTicks) Executes a task on the global server thread after a specified delay.runTaskLaterAsynchronously
(Runnable runnable, long delayTicks) Executes an asynchronous task after a specified delay.runTaskTimer
(Runnable runnable, long delayTicks, long periodTicks) Executes a repeating task on the global server thread.runTaskTimerAsynchronously
(Runnable runnable, long delayTicks, long periodTicks) Executes an asynchronous repeating task.
-
Method Details
-
runEntityTask
Executes a task specifically linked to an entity immediately. On Spigot, this defaults to the global thread. -
runEntityTaskLater
Executes a task specifically linked to an entity after a delay. On Spigot, this defaults to the global thread.- Parameters:
delayTicks
- Delay before execution, measured in ticks.
-
runEntityTaskTimer
SchedulerTask runEntityTaskTimer(Entity entity, Runnable runnable, long delayTicks, long periodTicks) Executes a repeating task specifically linked to an entity. On Spigot, this defaults to the global thread.- Parameters:
delayTicks
- Initial delay before the first execution (in ticks).periodTicks
- Period between each subsequent execution (in ticks).
-
runRegionTask
Executes a task associated with a specific region or chunk. On Spigot, this defaults to the global thread. -
runRegionTask
Executes a task associated with a specific region or chunk. On Spigot, this defaults to the global thread. -
runRegionTaskLater
Executes a task associated with a specific region or chunk after a delay. On Spigot, this defaults to the global thread.- Parameters:
delayTicks
- Delay before execution, measured in ticks.
-
runRegionTaskLater
SchedulerTask runRegionTaskLater(World world, int chunkX, int chunkZ, Runnable runnable, long delayTicks) Executes a task associated with a specific region or chunk after a delay. On Spigot, this defaults to the global thread.- Parameters:
delayTicks
- Delay before execution, measured in ticks.
-
runRegionTaskTimer
SchedulerTask runRegionTaskTimer(Location location, Runnable runnable, long delayTicks, long periodTicks) Executes a repeating task associated with a specific region or chunk. On Spigot, this defaults to the global thread.- Parameters:
delayTicks
- Initial delay before the first execution (in ticks).periodTicks
- Period between each subsequent execution (in ticks).
-
runRegionTaskTimer
SchedulerTask runRegionTaskTimer(World world, int chunkX, int chunkZ, Runnable runnable, long delayTicks, long periodTicks) Executes a repeating task associated with a specific region or chunk. On Spigot, this defaults to the global thread.- Parameters:
delayTicks
- Initial delay before the first execution (in ticks).periodTicks
- Period between each subsequent execution (in ticks).
-
runTask
Executes a task on the global server thread. -
runTaskAsynchronously
Executes a task asynchronously immediately, off the main server thread. -
runTaskLater
Executes a task on the global server thread after a specified delay.- Parameters:
delayTicks
- Delay before execution, measured in server ticks (1 tick = 50ms).
-
runTaskLaterAsynchronously
Executes an asynchronous task after a specified delay.- Parameters:
delayTicks
- Delay before execution, measured in ticks.
-
runTaskTimer
Executes a repeating task on the global server thread.- Parameters:
delayTicks
- Initial delay before the first execution (in ticks).periodTicks
- Period between each subsequent execution (in ticks).
-
runTaskTimerAsynchronously
Executes an asynchronous repeating task.- Parameters:
delayTicks
- Initial delay before the first execution (in ticks).periodTicks
- Period between each subsequent execution (in ticks).
-