FoliaScheduler
public FoliaScheduler(Plugin plugin)Creates a scheduler for a plugin.
me.tamkungz.signals.folia.FoliaScheduler
Small wrapper over the Folia schedulers for one plugin.
<p>
On Folia every region ticks on its own thread, so code that touches a block, chunk or entity must run on the
thread that owns it. The methods here pick the matching scheduler; {@link #ownsRegion(Location)},
{@link #ownsEntity(Entity)} and {@link #isGlobalThread()} tell whether the current thread already is that
thread. Outside Folia, Paper runs the same schedulers on the main thread.
public final class FoliaSchedulerpublic FoliaScheduler(Plugin plugin)Creates a scheduler for a plugin.
public static boolean isFolia()Tells whether the server is Folia.
public Plugin plugin()Returns the plugin that owns the scheduled tasks.
public boolean isGlobalThread()Tells whether the current thread is the global region thread (the main thread outside Folia).
public boolean ownsRegion(Location location)Tells whether the current thread owns the region around a location.
public boolean ownsEntity(Entity entity)Tells whether the current thread owns an entity.
public void global(Runnable task)Runs a task on the next tick of the global region.
public void region(Location location, Runnable task)Runs a task on the next tick of the region that owns a location.
public void region(World world, int chunkX, int chunkZ, Runnable task)Runs a task on the next tick of the region that owns a chunk.
public boolean entity(Entity entity, Runnable task, Runnable retired)Runs a task on the next tick of the region that owns an entity, following the entity if it moves.
public void async(Runnable task)Runs a task right away on a thread that is not tied to any region.