Package redempt.redlib.misc
Class Task
java.lang.Object
redempt.redlib.misc.Task
Simple utility for Bukkit scheduler tasks, essentially just shorthand
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic TaskasyncDelayed(Runnable run) Schedules an async delayed task to run as soon as possiblestatic TaskasyncDelayed(Runnable run, long delay) Schedules an async delayed task to run after a delaystatic TaskasyncDelayed(Consumer<Task> run) Schedules an async delayed task to run as soon as possiblestatic TaskasyncDelayed(Consumer<Task> run, long delay) Schedules an async delayed task to run after a delaystatic TaskasyncDelayed(org.bukkit.plugin.Plugin plugin, Runnable run) Schedules an async delayed task to run as soon as possiblestatic TaskasyncDelayed(org.bukkit.plugin.Plugin plugin, Runnable run, long delay) Schedules an async delayed task to run after a delaystatic TaskasyncDelayed(org.bukkit.plugin.Plugin plugin, Consumer<Task> run) Schedules an async delayed task to run as soon as possiblestatic TaskasyncDelayed(org.bukkit.plugin.Plugin plugin, Consumer<Task> run, long delay) Schedules an async delayed task to run after a delaystatic TaskasyncRepeating(Runnable run, long delay, long period) Schedules an async repeating task to run laterstatic TaskasyncRepeating(Consumer<Task> run, long delay, long period) Schedules an async repeating task to run laterstatic TaskasyncRepeating(org.bukkit.plugin.Plugin plugin, Runnable run, long delay, long period) Schedules an async repeating task to run laterstatic TaskasyncRepeating(org.bukkit.plugin.Plugin plugin, Consumer<Task> run, long delay, long period) Schedules an async repeating task to run latervoidcancel()Cancels this task, same asBukkitScheduler.cancelTask(int)org.bukkit.plugin.PlugingetType()booleanbooleanisQueued()static TasksyncDelayed(Runnable run) Schedules a sync delayed task to run as soon as possiblestatic TasksyncDelayed(Runnable run, long delay) Schedules a sync delayed task to run after a delaystatic TasksyncDelayed(Consumer<Task> run) Schedules a sync delayed task to run as soon as possiblestatic TasksyncDelayed(Consumer<Task> run, long delay) Schedules a sync delayed task to run after a delaystatic TasksyncDelayed(org.bukkit.plugin.Plugin plugin, Runnable run) Schedules a sync delayed task to run as soon as possiblestatic TasksyncDelayed(org.bukkit.plugin.Plugin plugin, Runnable run, long delay) Schedules a sync delayed task to run after a delaystatic TasksyncDelayed(org.bukkit.plugin.Plugin plugin, Consumer<Task> run) Schedules a sync delayed task to run as soon as possiblestatic TasksyncDelayed(org.bukkit.plugin.Plugin plugin, Consumer<Task> run, long delay) Schedules a sync delayed task to run after a delaystatic TasksyncRepeating(Runnable run, long delay, long period) Schedules a sync repeating task to run laterstatic TasksyncRepeating(Consumer<Task> run, long delay, long period) Schedules a sync repeating task to run laterstatic TasksyncRepeating(org.bukkit.plugin.Plugin plugin, Runnable run, long delay, long period) Schedules a sync repeating task to run laterstatic TasksyncRepeating(org.bukkit.plugin.Plugin plugin, Consumer<Task> run, long delay, long period) Schedules a sync repeating task to run later
-
Method Details
-
syncDelayed
Schedules a sync delayed task to run as soon as possible- Parameters:
run- The task to run- Returns:
- The Task that has been scheduled
-
syncDelayed
Schedules a sync delayed task to run as soon as possible- Parameters:
plugin- The plugin scheduling the taskrun- The task to run- Returns:
- The Task that has been scheduled
-
syncDelayed
Schedules a sync delayed task to run as soon as possible- Parameters:
run- The task to run- Returns:
- The Task that has been scheduled
-
syncDelayed
Schedules a sync delayed task to run as soon as possible- Parameters:
plugin- The plugin scheduling the taskrun- The task to run- Returns:
- The Task that has been scheduled
-
syncDelayed
Schedules a sync delayed task to run after a delay- Parameters:
run- The task to rundelay- The delay in ticks to wait before running the task- Returns:
- The Task that has been scheduled
-
syncDelayed
Schedules a sync delayed task to run after a delay- Parameters:
plugin- The plugin scheduling the taskrun- The task to rundelay- The delay in ticks to wait before running the task- Returns:
- The Task that has been scheduled
-
syncDelayed
Schedules a sync delayed task to run after a delay- Parameters:
run- The task to rundelay- The delay in ticks to wait before running the task- Returns:
- The Task that has been scheduled
-
syncDelayed
Schedules a sync delayed task to run after a delay- Parameters:
plugin- The plugin scheduling the taskrun- The task to rundelay- The delay in ticks to wait before running the task- Returns:
- The Task that has been scheduled
-
syncRepeating
Schedules a sync repeating task to run later- Parameters:
run- The task to rundelay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the task- Returns:
- The Task that has been scheduled
-
syncRepeating
public static Task syncRepeating(org.bukkit.plugin.Plugin plugin, Runnable run, long delay, long period) Schedules a sync repeating task to run later- Parameters:
plugin- The plugin scheduling the taskrun- The task to rundelay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the task- Returns:
- The Task that has been scheduled
-
syncRepeating
Schedules a sync repeating task to run later- Parameters:
run- The task to rundelay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the task- Returns:
- The Task that has been scheduled
-
syncRepeating
public static Task syncRepeating(org.bukkit.plugin.Plugin plugin, Consumer<Task> run, long delay, long period) Schedules a sync repeating task to run later- Parameters:
plugin- The plugin scheduling the taskrun- The task to rundelay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the task- Returns:
- The Task that has been scheduled
-
asyncDelayed
Schedules an async delayed task to run as soon as possible- Parameters:
run- The task to run- Returns:
- The Task that has been scheduled
-
asyncDelayed
Schedules an async delayed task to run as soon as possible- Parameters:
plugin- The plugin scheduling the taskrun- The task to run- Returns:
- The Task that has been scheduled
-
asyncDelayed
Schedules an async delayed task to run as soon as possible- Parameters:
run- The task to run- Returns:
- The Task that has been scheduled
-
asyncDelayed
Schedules an async delayed task to run as soon as possible- Parameters:
plugin- The plugin scheduling the taskrun- The task to run- Returns:
- The Task that has been scheduled
-
asyncDelayed
Schedules an async delayed task to run after a delay- Parameters:
run- The task to rundelay- The delay in ticks to wait before running the task- Returns:
- The Task that has been scheduled
-
asyncDelayed
Schedules an async delayed task to run after a delay- Parameters:
plugin- The plugin scheduling the taskrun- The task to rundelay- The delay in ticks to wait before running the task- Returns:
- The Task that has been scheduled
-
asyncDelayed
Schedules an async delayed task to run after a delay- Parameters:
run- The task to rundelay- The delay in ticks to wait before running the task- Returns:
- The Task that has been scheduled
-
asyncDelayed
Schedules an async delayed task to run after a delay- Parameters:
plugin- The plugin scheduling the taskrun- The task to rundelay- The delay in ticks to wait before running the task- Returns:
- The Task that has been scheduled
-
asyncRepeating
Schedules an async repeating task to run later- Parameters:
run- The task to rundelay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the task- Returns:
- The Task that has been scheduled
-
asyncRepeating
public static Task asyncRepeating(org.bukkit.plugin.Plugin plugin, Consumer<Task> run, long delay, long period) Schedules an async repeating task to run later- Parameters:
plugin- The plugin scheduling the taskrun- The task to rundelay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the task- Returns:
- The Task that has been scheduled
-
asyncRepeating
Schedules an async repeating task to run later- Parameters:
run- The task to rundelay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the task- Returns:
- The Task that has been scheduled
-
asyncRepeating
public static Task asyncRepeating(org.bukkit.plugin.Plugin plugin, Runnable run, long delay, long period) Schedules an async repeating task to run later- Parameters:
plugin- The plugin scheduling the taskrun- The task to rundelay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the task- Returns:
- The Task that has been scheduled
-
getType
- Returns:
- The type of this Task
-
isQueued
public boolean isQueued()- Returns:
- Whether this Task is queued, same as
BukkitScheduler.isQueued(int)
-
isCurrentlyRunning
public boolean isCurrentlyRunning()- Returns:
- Whether this Task is currently running, same as
BukkitScheduler.isCurrentlyRunning(int)
-
cancel
public void cancel()Cancels this task, same asBukkitScheduler.cancelTask(int) -
getPlugin
public org.bukkit.plugin.Plugin getPlugin()- Returns:
- The Plugin which scheduled this task
-