Package dev.cwhead.GravesX.manager
Class SchedulerManager.Returnable
java.lang.Object
dev.cwhead.GravesX.manager.SchedulerManager.Returnable
- Enclosing class:
SchedulerManager
Returnable scheduler API for when a task handle is needed.
-
Method Summary
Modifier and TypeMethodDescription<T> @NotNull Future<T> callSyncMethod(@NotNull Callable<T> task) Calls a task on the global/main thread and returns aFuture.@NotNull SchedulerManager.TaskSchedules a task for the next tick (global/main).@NotNull SchedulerManager.TaskSchedules a task on the region that owns the provided location.@NotNull SchedulerManager.TaskSchedules a task on the region that owns the provided entity.@NotNull SchedulerManager.TaskDeprecated.@NotNull SchedulerManager.TaskrunTaskAsynchronously(@NotNull Runnable runnable) Schedules an async task immediately.@NotNull SchedulerManager.TaskrunTaskAsynchronously(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull Runnable runnable) Deprecated.@NotNull SchedulerManager.TaskrunTaskLater(@NotNull Runnable runnable, long delay) Schedules a delayed task (global/main).@NotNull SchedulerManager.TaskrunTaskLater(@NotNull org.bukkit.Location location, @NotNull Runnable runnable, long delay) Schedules a delayed task on the region that owns the provided location.@NotNull SchedulerManager.TaskrunTaskLater(@NotNull org.bukkit.entity.Entity entity, @NotNull Runnable runnable, long delay) Schedules a delayed task on the region that owns the provided entity.@NotNull SchedulerManager.TaskrunTaskLater(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull Runnable runnable, long delay) Deprecated.@NotNull SchedulerManager.TaskrunTaskLaterAsynchronously(@NotNull Runnable runnable, long delay) Schedules an async task after a delay.@NotNull SchedulerManager.TaskrunTaskLaterAsynchronously(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull Runnable runnable, long delay) Deprecated.@NotNull SchedulerManager.TaskrunTaskTimer(@NotNull Runnable runnable, long delay, long period) Schedules a repeating task (global/main).@NotNull SchedulerManager.TaskrunTaskTimer(@NotNull org.bukkit.Location location, @NotNull Runnable runnable, long delay, long period) Schedules a repeating task on the region that owns the provided location.@NotNull SchedulerManager.TaskrunTaskTimer(@NotNull org.bukkit.entity.Entity entity, @NotNull Runnable runnable, long delay, long period) Schedules a repeating task on the region that owns the provided entity.@NotNull SchedulerManager.TaskrunTaskTimer(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull Runnable runnable, long delay, long period) Deprecated.@NotNull SchedulerManager.TaskrunTaskTimerAsynchronously(@NotNull Runnable runnable, long delay, long period) Schedules a repeating async task.@NotNull SchedulerManager.TaskrunTaskTimerAsynchronously(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull Runnable runnable, long delay, long period) Deprecated.@NotNull SchedulerManager.TaskscheduleSyncDelayedTask(@NotNull Runnable runnable) Deprecated.UserunTask(Runnable).@NotNull SchedulerManager.TaskscheduleSyncDelayedTask(@NotNull Runnable runnable, long delay) Deprecated.@NotNull SchedulerManager.TaskscheduleSyncRepeatingTask(@NotNull Runnable runnable, long delay, long period) Deprecated.@NotNull SchedulerManager.Taskwrap(@NotNull me.croabeast.scheduler.GlobalTask task) Wraps aGlobalTaskwith a reference back to the owningSchedulerManager.@Nullable SchedulerManager.TaskwrapNullable(@Nullable me.croabeast.scheduler.GlobalTask task) Wraps aGlobalTaskif present.
-
Method Details
-
callSyncMethod
Calls a task on the global/main thread and returns aFuture.- 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 aGlobalTaskwith a reference back to the owningSchedulerManager.- Parameters:
task- task handle- Returns:
- managed task
-
wrapNullable
@Nullable public @Nullable SchedulerManager.Task wrapNullable(@Nullable @Nullable me.croabeast.scheduler.GlobalTask task) Wraps aGlobalTaskif present.- Parameters:
task- task handle (nullable)- Returns:
- managed task (or null)
-
runTask
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.UserunTask(Runnable).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 rundelay- 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) Deprecated.Schedules a delayed task (legacy signature).- Parameters:
plugin- plugin (legacy parameter)runnable- task to rundelay- 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 rundelay- initial delay in ticksperiod- 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) Deprecated.Schedules a repeating task (legacy signature).- Parameters:
plugin- plugin (legacy parameter)runnable- task to rundelay- initial delay in ticksperiod- 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 contextrunnable- 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 contextrunnable- task to rundelay- 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 contextrunnable- task to rundelay- initial delay in ticksperiod- 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 contextrunnable- 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 contextrunnable- task to rundelay- 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 contextrunnable- task to rundelay- initial delay in ticksperiod- 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) Deprecated.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 rundelay- 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) Deprecated.Schedules an async task after a delay (legacy signature).- Parameters:
plugin- plugin (legacy parameter)runnable- task to rundelay- 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 rundelay- initial delay in ticksperiod- 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) Deprecated.Schedules a repeating async task (legacy signature).- Parameters:
plugin- plugin (legacy parameter)runnable- task to rundelay- initial delay in ticksperiod- period in ticks- Returns:
- managed task handle
-
scheduleSyncDelayedTask
@Deprecated @NotNull public @NotNull SchedulerManager.Task scheduleSyncDelayedTask(@NotNull @NotNull Runnable runnable) Deprecated.UserunTask(Runnable).Legacy alias forrunTask(Runnable).- Parameters:
runnable- task to run- Returns:
- managed task handle
-
scheduleSyncDelayedTask
@Deprecated @NotNull public @NotNull SchedulerManager.Task scheduleSyncDelayedTask(@NotNull @NotNull Runnable runnable, long delay) Deprecated.Legacy alias forrunTaskLater(Runnable, long).- Parameters:
runnable- task to rundelay- delay in ticks- Returns:
- managed task handle
-
scheduleSyncRepeatingTask
@Deprecated @NotNull public @NotNull SchedulerManager.Task scheduleSyncRepeatingTask(@NotNull @NotNull Runnable runnable, long delay, long period) Deprecated.Legacy alias forrunTaskTimer(Runnable, long, long).- Parameters:
runnable- task to rundelay- initial delay in ticksperiod- period in ticks- Returns:
- managed task handle
-
runTask(Runnable).