Class SpigotScheduler

java.lang.Object
net.citizensnpcs.api.util.schedulers.adapter.SpigotScheduler
All Implemented Interfaces:
SchedulerAdapter

public class SpigotScheduler extends Object implements SchedulerAdapter
  • Constructor Details

    • SpigotScheduler

      public SpigotScheduler(Plugin plugin)
  • Method Details

    • runEntityTask

      public SchedulerTask runEntityTask(Entity entity, Runnable runnable)
      Description copied from interface: SchedulerAdapter
      Executes a task specifically linked to an entity immediately. On Spigot, this defaults to the global thread.
      Specified by:
      runEntityTask in interface SchedulerAdapter
    • runEntityTaskLater

      public SchedulerTask runEntityTaskLater(Entity entity, Runnable runnable, long delayTicks)
      Description copied from interface: SchedulerAdapter
      Executes a task specifically linked to an entity after a delay. On Spigot, this defaults to the global thread.
      Specified by:
      runEntityTaskLater in interface SchedulerAdapter
      Parameters:
      delayTicks - Delay before execution, measured in ticks.
    • runEntityTaskTimer

      public SchedulerTask runEntityTaskTimer(Entity entity, Runnable runnable, long delayTicks, long periodTicks)
      Description copied from interface: SchedulerAdapter
      Executes a repeating task specifically linked to an entity. On Spigot, this defaults to the global thread.
      Specified by:
      runEntityTaskTimer in interface SchedulerAdapter
      Parameters:
      delayTicks - Initial delay before the first execution (in ticks).
      periodTicks - Period between each subsequent execution (in ticks).
    • runRegionTask

      public SchedulerTask runRegionTask(Location location, Runnable runnable)
      Description copied from interface: SchedulerAdapter
      Executes a task associated with a specific region or chunk. On Spigot, this defaults to the global thread.
      Specified by:
      runRegionTask in interface SchedulerAdapter
    • runRegionTask

      public SchedulerTask runRegionTask(World world, int chunkX, int chunkZ, Runnable runnable)
      Description copied from interface: SchedulerAdapter
      Executes a task associated with a specific region or chunk. On Spigot, this defaults to the global thread.
      Specified by:
      runRegionTask in interface SchedulerAdapter
    • runRegionTaskLater

      public SchedulerTask runRegionTaskLater(Location location, Runnable runnable, long delayTicks)
      Description copied from interface: SchedulerAdapter
      Executes a task associated with a specific region or chunk after a delay. On Spigot, this defaults to the global thread.
      Specified by:
      runRegionTaskLater in interface SchedulerAdapter
      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: SchedulerAdapter
      Executes a task associated with a specific region or chunk after a delay. On Spigot, this defaults to the global thread.
      Specified by:
      runRegionTaskLater in interface SchedulerAdapter
      Parameters:
      delayTicks - Delay before execution, measured in ticks.
    • runRegionTaskTimer

      public SchedulerTask runRegionTaskTimer(Location location, Runnable runnable, long delayTicks, long periodTicks)
      Description copied from interface: SchedulerAdapter
      Executes a repeating task associated with a specific region or chunk. On Spigot, this defaults to the global thread.
      Specified by:
      runRegionTaskTimer in interface SchedulerAdapter
      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: SchedulerAdapter
      Executes a repeating task associated with a specific region or chunk. On Spigot, this defaults to the global thread.
      Specified by:
      runRegionTaskTimer in interface SchedulerAdapter
      Parameters:
      delayTicks - Initial delay before the first execution (in ticks).
      periodTicks - Period between each subsequent execution (in ticks).
    • runTask

      public SchedulerTask runTask(Runnable runnable)
      Description copied from interface: SchedulerAdapter
      Executes a task on the global server thread.
      Specified by:
      runTask in interface SchedulerAdapter
    • runTaskAsynchronously

      public SchedulerTask runTaskAsynchronously(Runnable runnable)
      Description copied from interface: SchedulerAdapter
      Executes a task asynchronously immediately, off the main server thread.
      Specified by:
      runTaskAsynchronously in interface SchedulerAdapter
    • runTaskLater

      public SchedulerTask runTaskLater(Runnable runnable, long delayTicks)
      Description copied from interface: SchedulerAdapter
      Executes a task on the global server thread after a specified delay.
      Specified by:
      runTaskLater in interface SchedulerAdapter
      Parameters:
      delayTicks - Delay before execution, measured in server ticks (1 tick = 50ms).
    • runTaskLaterAsynchronously

      public SchedulerTask runTaskLaterAsynchronously(Runnable runnable, long delayTicks)
      Description copied from interface: SchedulerAdapter
      Executes an asynchronous task after a specified delay.
      Specified by:
      runTaskLaterAsynchronously in interface SchedulerAdapter
      Parameters:
      delayTicks - Delay before execution, measured in ticks.
    • runTaskTimer

      public SchedulerTask runTaskTimer(Runnable runnable, long delayTicks, long periodTicks)
      Description copied from interface: SchedulerAdapter
      Executes a repeating task on the global server thread.
      Specified by:
      runTaskTimer in interface SchedulerAdapter
      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: SchedulerAdapter
      Executes an asynchronous repeating task.
      Specified by:
      runTaskTimerAsynchronously in interface SchedulerAdapter
      Parameters:
      delayTicks - Initial delay before the first execution (in ticks).
      periodTicks - Period between each subsequent execution (in ticks).