Class FoliaScheduler
java.lang.Object
net.citizensnpcs.api.util.schedulers.adapter.FoliaScheduler
- All Implemented Interfaces:
SchedulerAdapter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisOnOwnerThread(Block block) Returns true if the current thread is the correct owner thread for safely accessing the target.booleanisOnOwnerThread(Entity entity) Returns true if the current thread is the correct owner thread for safely accessing the target.booleanisOnOwnerThread(Location location) Returns true if the current thread is the correct owner thread for safely accessing the target.booleanisOnOwnerThread(World world, int chunkX, int chunkZ) Returns true if the current thread is the correct owner thread for safely accessing the target.runEntityTask(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.
-
Constructor Details
-
FoliaScheduler
-
-
Method Details
-
runEntityTask
Description copied from interface:SchedulerAdapterExecutes a task specifically linked to an entity immediately. On Spigot, this defaults to the global thread.- Specified by:
runEntityTaskin interfaceSchedulerAdapter
-
runEntityTaskLater
Description copied from interface:SchedulerAdapterExecutes a task specifically linked to an entity after a delay. On Spigot, this defaults to the global thread.- Specified by:
runEntityTaskLaterin interfaceSchedulerAdapter- Parameters:
delayTicks- Delay before execution, measured in ticks.
-
runEntityTaskTimer
public SchedulerTask runEntityTaskTimer(Entity entity, Runnable runnable, long delayTicks, long periodTicks) Description copied from interface:SchedulerAdapterExecutes a repeating task specifically linked to an entity. On Spigot, this defaults to the global thread.- Specified by:
runEntityTaskTimerin interfaceSchedulerAdapter- Parameters:
delayTicks- Initial delay before the first execution (in ticks).periodTicks- Period between each subsequent execution (in ticks).
-
runRegionTask
Description copied from interface:SchedulerAdapterExecutes a task associated with a specific region or chunk. On Spigot, this defaults to the global thread.- Specified by:
runRegionTaskin interfaceSchedulerAdapter
-
runRegionTask
Description copied from interface:SchedulerAdapterExecutes a task associated with a specific region or chunk. On Spigot, this defaults to the global thread.- Specified by:
runRegionTaskin interfaceSchedulerAdapter
-
runRegionTaskLater
Description copied from interface:SchedulerAdapterExecutes a task associated with a specific region or chunk after a delay. On Spigot, this defaults to the global thread.- Specified by:
runRegionTaskLaterin interfaceSchedulerAdapter- Parameters:
delayTicks- Delay before execution, measured in ticks.
-
runRegionTaskLater
public SchedulerTask runRegionTaskLater(World world, int chunkX, int chunkZ, Runnable runnable, long delayTicks) Description copied from interface:SchedulerAdapterExecutes a task associated with a specific region or chunk after a delay. On Spigot, this defaults to the global thread.- Specified by:
runRegionTaskLaterin interfaceSchedulerAdapter- Parameters:
delayTicks- Delay before execution, measured in ticks.
-
runRegionTaskTimer
public SchedulerTask runRegionTaskTimer(Location location, Runnable runnable, long delayTicks, long periodTicks) Description copied from interface:SchedulerAdapterExecutes a repeating task associated with a specific region or chunk. On Spigot, this defaults to the global thread.- Specified by:
runRegionTaskTimerin interfaceSchedulerAdapter- Parameters:
delayTicks- Initial delay before the first execution (in ticks).periodTicks- Period between each subsequent execution (in ticks).
-
runRegionTaskTimer
public SchedulerTask runRegionTaskTimer(World world, int chunkX, int chunkZ, Runnable runnable, long delayTicks, long periodTicks) Description copied from interface:SchedulerAdapterExecutes a repeating task associated with a specific region or chunk. On Spigot, this defaults to the global thread.- Specified by:
runRegionTaskTimerin interfaceSchedulerAdapter- Parameters:
delayTicks- Initial delay before the first execution (in ticks).periodTicks- Period between each subsequent execution (in ticks).
-
runTask
Description copied from interface:SchedulerAdapterExecutes a task on the global server thread.- Specified by:
runTaskin interfaceSchedulerAdapter
-
runTaskAsynchronously
Description copied from interface:SchedulerAdapterExecutes a task asynchronously immediately, off the main server thread.- Specified by:
runTaskAsynchronouslyin interfaceSchedulerAdapter
-
runTaskLater
Description copied from interface:SchedulerAdapterExecutes a task on the global server thread after a specified delay.- Specified by:
runTaskLaterin interfaceSchedulerAdapter- Parameters:
delayTicks- Delay before execution, measured in server ticks (1 tick = 50ms).
-
runTaskLaterAsynchronously
Description copied from interface:SchedulerAdapterExecutes an asynchronous task after a specified delay.- Specified by:
runTaskLaterAsynchronouslyin interfaceSchedulerAdapter- Parameters:
delayTicks- Delay before execution, measured in ticks.
-
runTaskTimer
Description copied from interface:SchedulerAdapterExecutes a repeating task on the global server thread.- Specified by:
runTaskTimerin interfaceSchedulerAdapter- Parameters:
delayTicks- Initial delay before the first execution (in ticks).periodTicks- Period between each subsequent execution (in ticks).
-
runTaskTimerAsynchronously
public SchedulerTask runTaskTimerAsynchronously(Runnable runnable, long delayTicks, long periodTicks) Description copied from interface:SchedulerAdapterExecutes an asynchronous repeating task.- Specified by:
runTaskTimerAsynchronouslyin interfaceSchedulerAdapter- Parameters:
delayTicks- Initial delay before the first execution (in ticks).periodTicks- Period between each subsequent execution (in ticks).
-
isOnOwnerThread
Description copied from interface:SchedulerAdapterReturns true if the current thread is the correct owner thread for safely accessing the target.Spigot: true if running on the main server thread.
Folia: true if the current thread owns the target's region (isOwnedByCurrentRegion).
- Specified by:
isOnOwnerThreadin interfaceSchedulerAdapter- Parameters:
entity- the target entity- Returns:
trueif the current thread is the owner thread for the entity;falseotherwise
-
isOnOwnerThread
Description copied from interface:SchedulerAdapterReturns true if the current thread is the correct owner thread for safely accessing the target.Spigot: true if running on the main server thread.
Folia: true if the current thread owns the target's region (isOwnedByCurrentRegion).
- Specified by:
isOnOwnerThreadin interfaceSchedulerAdapter- Parameters:
location- the target location- Returns:
trueif the current thread is the owner thread for the location;falseotherwise
-
isOnOwnerThread
Description copied from interface:SchedulerAdapterReturns true if the current thread is the correct owner thread for safely accessing the target.Spigot: true if running on the main server thread.
Folia: true if the current thread owns the target's region (isOwnedByCurrentRegion).
- Specified by:
isOnOwnerThreadin interfaceSchedulerAdapter- Parameters:
world- the target worldchunkX- the target chunk X coordinatechunkZ- the target chunk Z coordinate- Returns:
trueif the current thread is the owner thread for the chunk;falseotherwise
-
isOnOwnerThread
Description copied from interface:SchedulerAdapterReturns true if the current thread is the correct owner thread for safely accessing the target.Spigot: true if running on the main server thread.
Folia: true if the current thread owns the target's region (isOwnedByCurrentRegion).
- Specified by:
isOnOwnerThreadin interfaceSchedulerAdapter- Parameters:
block- the target block- Returns:
trueif the current thread is the owner thread for the block;falseotherwise
-