Class SchedulerManager.Returnable

java.lang.Object
dev.cwhead.GravesX.manager.SchedulerManager.Returnable
Enclosing class:
SchedulerManager

public static final class SchedulerManager.Returnable extends Object
Returnable scheduler API for when a task handle is needed.
  • Method Details

    • callSyncMethod

      @NotNull public <T> @NotNull Future<T> callSyncMethod(@NotNull @NotNull Callable<T> task)
      Calls a task on the global/main thread and returns a Future.
      Type Parameters:
      T - result type
      Parameters:
      task - callable to execute
      Returns:
      future result
    • wrap

      @NotNull public @NotNull SchedulerManager.Task wrap(@NotNull @NotNull me.croabeast.scheduler.GlobalTask task)
      Wraps a GlobalTask with a reference back to the owning SchedulerManager.
      Parameters:
      task - task handle
      Returns:
      managed task
    • wrapNullable

      @Nullable public @Nullable SchedulerManager.Task wrapNullable(@Nullable @Nullable me.croabeast.scheduler.GlobalTask task)
      Wraps a GlobalTask if present.
      Parameters:
      task - task handle (nullable)
      Returns:
      managed task (or null)
    • runTask

      @NotNull public @NotNull SchedulerManager.Task runTask(@NotNull @NotNull Runnable runnable)
      Schedules a task for the next tick (global/main).
      Parameters:
      runnable - task to run
      Returns:
      managed task handle
    • runTask

      @Deprecated @NotNull public @NotNull SchedulerManager.Task runTask(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull Runnable runnable)
      Deprecated.
      Schedules a task for the next tick (legacy signature).
      Parameters:
      plugin - plugin (legacy parameter)
      runnable - task to run
      Returns:
      managed task handle
    • runTaskLater

      @NotNull public @NotNull SchedulerManager.Task runTaskLater(@NotNull @NotNull Runnable runnable, long delay)
      Schedules a delayed task (global/main).
      Parameters:
      runnable - task to run
      delay - delay in ticks
      Returns:
      managed task handle
    • runTaskLater

      @Deprecated @NotNull public @NotNull SchedulerManager.Task runTaskLater(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull Runnable runnable, long delay)
      Schedules a delayed task (legacy signature).
      Parameters:
      plugin - plugin (legacy parameter)
      runnable - task to run
      delay - delay in ticks
      Returns:
      managed task handle
    • runTaskTimer

      @NotNull public @NotNull SchedulerManager.Task runTaskTimer(@NotNull @NotNull Runnable runnable, long delay, long period)
      Schedules a repeating task (global/main).
      Parameters:
      runnable - task to run
      delay - initial delay in ticks
      period - period in ticks
      Returns:
      managed task handle
    • runTaskTimer

      @Deprecated @NotNull public @NotNull SchedulerManager.Task runTaskTimer(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull Runnable runnable, long delay, long period)
      Schedules a repeating task (legacy signature).
      Parameters:
      plugin - plugin (legacy parameter)
      runnable - task to run
      delay - initial delay in ticks
      period - period in ticks
      Returns:
      managed task handle
    • runTask

      @NotNull public @NotNull SchedulerManager.Task runTask(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull Runnable runnable)
      Schedules a task on the region that owns the provided location.
      Parameters:
      location - location context
      runnable - task to run
      Returns:
      managed task handle
    • runTaskLater

      @NotNull public @NotNull SchedulerManager.Task runTaskLater(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull Runnable runnable, long delay)
      Schedules a delayed task on the region that owns the provided location.
      Parameters:
      location - location context
      runnable - task to run
      delay - delay in ticks
      Returns:
      managed task handle
    • runTaskTimer

      @NotNull public @NotNull SchedulerManager.Task runTaskTimer(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull Runnable runnable, long delay, long period)
      Schedules a repeating task on the region that owns the provided location.
      Parameters:
      location - location context
      runnable - task to run
      delay - initial delay in ticks
      period - period in ticks
      Returns:
      managed task handle
    • runTask

      @NotNull public @NotNull SchedulerManager.Task runTask(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull Runnable runnable)
      Schedules a task on the region that owns the provided entity.
      Parameters:
      entity - entity context
      runnable - task to run
      Returns:
      managed task handle
    • runTaskLater

      @NotNull public @NotNull SchedulerManager.Task runTaskLater(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull Runnable runnable, long delay)
      Schedules a delayed task on the region that owns the provided entity.
      Parameters:
      entity - entity context
      runnable - task to run
      delay - delay in ticks
      Returns:
      managed task handle
    • runTaskTimer

      @NotNull public @NotNull SchedulerManager.Task runTaskTimer(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull Runnable runnable, long delay, long period)
      Schedules a repeating task on the region that owns the provided entity.
      Parameters:
      entity - entity context
      runnable - task to run
      delay - initial delay in ticks
      period - period in ticks
      Returns:
      managed task handle
    • runTaskAsynchronously

      @NotNull public @NotNull SchedulerManager.Task runTaskAsynchronously(@NotNull @NotNull Runnable runnable)
      Schedules an async task immediately.
      Parameters:
      runnable - task to run
      Returns:
      managed task handle
    • runTaskAsynchronously

      @Deprecated @NotNull public @NotNull SchedulerManager.Task runTaskAsynchronously(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull Runnable runnable)
      Schedules an async task immediately (legacy signature).
      Parameters:
      plugin - plugin (legacy parameter)
      runnable - task to run
      Returns:
      managed task handle
    • runTaskLaterAsynchronously

      @NotNull public @NotNull SchedulerManager.Task runTaskLaterAsynchronously(@NotNull @NotNull Runnable runnable, long delay)
      Schedules an async task after a delay.
      Parameters:
      runnable - task to run
      delay - delay in ticks
      Returns:
      managed task handle
    • runTaskLaterAsynchronously

      @Deprecated @NotNull public @NotNull SchedulerManager.Task runTaskLaterAsynchronously(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull Runnable runnable, long delay)
      Schedules an async task after a delay (legacy signature).
      Parameters:
      plugin - plugin (legacy parameter)
      runnable - task to run
      delay - delay in ticks
      Returns:
      managed task handle
    • runTaskTimerAsynchronously

      @NotNull public @NotNull SchedulerManager.Task runTaskTimerAsynchronously(@NotNull @NotNull Runnable runnable, long delay, long period)
      Schedules a repeating async task.
      Parameters:
      runnable - task to run
      delay - initial delay in ticks
      period - period in ticks
      Returns:
      managed task handle
    • runTaskTimerAsynchronously

      @Deprecated @NotNull public @NotNull SchedulerManager.Task runTaskTimerAsynchronously(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull Runnable runnable, long delay, long period)
      Schedules a repeating async task (legacy signature).
      Parameters:
      plugin - plugin (legacy parameter)
      runnable - task to run
      delay - initial delay in ticks
      period - period in ticks
      Returns:
      managed task handle
    • scheduleSyncDelayedTask

      @Deprecated @NotNull public @NotNull SchedulerManager.Task scheduleSyncDelayedTask(@NotNull @NotNull Runnable runnable)
      Deprecated.
      Legacy alias for runTask(Runnable).
      Parameters:
      runnable - task to run
      Returns:
      managed task handle
    • scheduleSyncDelayedTask

      @Deprecated @NotNull public @NotNull SchedulerManager.Task scheduleSyncDelayedTask(@NotNull @NotNull Runnable runnable, long delay)
      Parameters:
      runnable - task to run
      delay - delay in ticks
      Returns:
      managed task handle
    • scheduleSyncRepeatingTask

      @Deprecated @NotNull public @NotNull SchedulerManager.Task scheduleSyncRepeatingTask(@NotNull @NotNull Runnable runnable, long delay, long period)
      Parameters:
      runnable - task to run
      delay - initial delay in ticks
      period - period in ticks
      Returns:
      managed task handle