Interface SchedulerAPI<E,L>


public interface SchedulerAPI<E,L>
Scheduler API with task management.
  • Method Details

    • runLater

      void runLater(String taskId, Runnable task, long delayTicks)
      Run task later (in ticks).
      Parameters:
      taskId - Unique identifier for this task (e.g., "arena_5_race_timer")
      task - Task to run
      delayTicks - Delay in ticks
    • runTimer

      void runTimer(String taskId, Runnable task, long delayTicks, long periodTicks)
      Run repeating task.
      Parameters:
      taskId - Unique identifier for this task (e.g., "arena_5_race_timer")
      task - Task to run
      delayTicks - Initial delay in ticks
      periodTicks - Period between executions in ticks
    • runAtEntity

      void runAtEntity(E entity, Runnable task)
      Run task at entity location (Folia-safe).
    • runAtLocation

      void runAtLocation(L location, Runnable task)
      Run task at location (Folia-safe).
    • cancelTask

      void cancelTask(String taskId)
      Cancel a specific task by ID.
      Parameters:
      taskId - Task identifier
    • cancelArenaTasks

      void cancelArenaTasks(int arenaId)
      Cancel all tasks for a specific arena.
      Parameters:
      arenaId - Arena ID
    • cancelModuleTasks

      void cancelModuleTasks(String moduleId)
      Cancel all tasks for a specific game module.
      Parameters:
      moduleId - Module ID (e.g., "race")
    • cancelAllTasks

      void cancelAllTasks()
      Cancel all tasks.
    • isTaskRunning

      boolean isTaskRunning(String taskId)
      Check if a task is running.
      Parameters:
      taskId - Task identifier
      Returns:
      true if task exists and is running