Interface BoxScheduler


public interface BoxScheduler
An interface to schedule tasks.

This interface does not have some scheduling methods like delaying or repeating.

  • Method Details

    • runAsyncTask

      void runAsyncTask(@NotNull @NotNull Runnable task)
      Executes a task on the async scheduler.
      Parameters:
      task - a Runnable to run
    • runEntityTask

      void runEntityTask(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull Runnable task)
      Executes a task on the entity scheduler.
      Parameters:
      entity - a Entity to get its scheduler
      task - a Runnable to run
    • scheduleAsyncTask

      void scheduleAsyncTask(@NotNull @NotNull Runnable task, long delay, @NotNull @NotNull TimeUnit unit)
      Schedules a delayed task.
      Parameters:
      task - a Runnable to run
      delay - a delay
      unit - a TimeUnit of delay
    • scheduleRepeatingAsyncTask

      void scheduleRepeatingAsyncTask(@NotNull @NotNull Runnable task, @NotNull @NotNull Duration interval, @NotNull @NotNull BooleanSupplier condition)
      Schedules a repeating task.
      Parameters:
      task - a Runnable to run
      interval - an interval
      condition - a BooleanSupplier that decides the task should be continued