Class BukkitScheduler

java.lang.Object
me.hsgamer.hscore.bukkit.scheduler.bukkit.BukkitScheduler
All Implemented Interfaces:
Scheduler

public class BukkitScheduler extends Object implements Scheduler
The Bukkit implementation of Scheduler
  • Constructor Details

    • BukkitScheduler

      public BukkitScheduler()
  • Method Details

    • cancelAllTasks

      public void cancelAllTasks(org.bukkit.plugin.Plugin plugin)
      Description copied from interface: Scheduler
      Cancel all tasks of the plugin
      Specified by:
      cancelAllTasks in interface Scheduler
      Parameters:
      plugin - the plugin
    • runTask

      public Task runTask(org.bukkit.plugin.Plugin plugin, Runnable runnable, boolean async)
      Description copied from interface: Scheduler
      Run a task
      Specified by:
      runTask in interface Scheduler
      Parameters:
      plugin - the plugin that owns the task
      runnable - the task
      async - whether the task is async
      Returns:
      the task
    • runTaskLater

      public Task runTaskLater(org.bukkit.plugin.Plugin plugin, Runnable runnable, long delay, boolean async)
      Description copied from interface: Scheduler
      Run a delayed task
      Specified by:
      runTaskLater in interface Scheduler
      Parameters:
      plugin - the plugin that owns the task
      runnable - the task
      delay - the delay in ticks before the task is run
      async - whether the task is async
      Returns:
      the task
    • runTaskTimer

      public Task runTaskTimer(org.bukkit.plugin.Plugin plugin, BooleanSupplier runnable, long delay, long period, boolean async)
      Description copied from interface: Scheduler
      Run a task repeatedly
      Specified by:
      runTaskTimer in interface Scheduler
      Parameters:
      plugin - the plugin that owns the task
      runnable - the task. Return true to continue, false to stop.
      delay - the delay in ticks before the task is run
      period - the period in ticks between each run
      async - whether the task is async
      Returns:
      the task
    • runEntityTask

      public Task runEntityTask(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable retired, boolean async)
      Description copied from interface: Scheduler
      Run a task related to an entity
      Specified by:
      runEntityTask in interface Scheduler
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task
      retired - the task when the entity is retired (e.g. removed, invalid)
      async - whether the task is async
      Returns:
      the task
    • runEntityTaskLater

      public Task runEntityTaskLater(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, Runnable runnable, Runnable retired, long delay, boolean async)
      Description copied from interface: Scheduler
      Run a delayed task related to an entity
      Specified by:
      runEntityTaskLater in interface Scheduler
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task
      retired - the task when the entity is retired (e.g. removed, invalid)
      delay - the delay in ticks before the task is run
      async - whether the task is async
      Returns:
      the task
    • runEntityTaskTimer

      public Task runEntityTaskTimer(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity, BooleanSupplier runnable, Runnable retired, long delay, long period, boolean async)
      Description copied from interface: Scheduler
      Run a task repeatedly related to an entity
      Specified by:
      runEntityTaskTimer in interface Scheduler
      Parameters:
      plugin - the plugin that owns the task
      entity - the entity that the task is related to
      runnable - the task. Return true to continue, false to stop.
      retired - the task when the entity is retired (e.g. removed, invalid)
      delay - the delay in ticks before the task is run
      period - the period in ticks between each run
      async - whether the task is async
      Returns:
      the task