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
-
Method Summary
Modifier and TypeMethodDescriptionstatic Task
asyncDelayed
(Runnable run) Schedules an async delayed task to run as soon as possiblestatic Task
asyncDelayed
(Runnable run, long delay) Schedules an async delayed task to run after a delaystatic Task
asyncDelayed
(Consumer<Task> run) Schedules an async delayed task to run as soon as possiblestatic Task
asyncDelayed
(Consumer<Task> run, long delay) Schedules an async delayed task to run after a delaystatic Task
asyncDelayed
(org.bukkit.plugin.Plugin plugin, Runnable run) Schedules an async delayed task to run as soon as possiblestatic Task
asyncDelayed
(org.bukkit.plugin.Plugin plugin, Runnable run, long delay) Schedules an async delayed task to run after a delaystatic Task
asyncDelayed
(org.bukkit.plugin.Plugin plugin, Consumer<Task> run) Schedules an async delayed task to run as soon as possiblestatic Task
asyncDelayed
(org.bukkit.plugin.Plugin plugin, Consumer<Task> run, long delay) Schedules an async delayed task to run after a delaystatic Task
asyncRepeating
(Runnable run, long delay, long period) Schedules an async repeating task to run laterstatic Task
asyncRepeating
(Consumer<Task> run, long delay, long period) Schedules an async repeating task to run laterstatic Task
asyncRepeating
(org.bukkit.plugin.Plugin plugin, Runnable run, long delay, long period) Schedules an async repeating task to run laterstatic Task
asyncRepeating
(org.bukkit.plugin.Plugin plugin, Consumer<Task> run, long delay, long period) Schedules an async repeating task to run latervoid
cancel()
Cancels this task, same asBukkitScheduler.cancelTask(int)
org.bukkit.plugin.Plugin
getType()
boolean
boolean
isQueued()
static Task
syncDelayed
(Runnable run) Schedules a sync delayed task to run as soon as possiblestatic Task
syncDelayed
(Runnable run, long delay) Schedules a sync delayed task to run after a delaystatic Task
syncDelayed
(Consumer<Task> run) Schedules a sync delayed task to run as soon as possiblestatic Task
syncDelayed
(Consumer<Task> run, long delay) Schedules a sync delayed task to run after a delaystatic Task
syncDelayed
(org.bukkit.plugin.Plugin plugin, Runnable run) Schedules a sync delayed task to run as soon as possiblestatic Task
syncDelayed
(org.bukkit.plugin.Plugin plugin, Runnable run, long delay) Schedules a sync delayed task to run after a delaystatic Task
syncDelayed
(org.bukkit.plugin.Plugin plugin, Consumer<Task> run) Schedules a sync delayed task to run as soon as possiblestatic Task
syncDelayed
(org.bukkit.plugin.Plugin plugin, Consumer<Task> run, long delay) Schedules a sync delayed task to run after a delaystatic Task
syncRepeating
(Runnable run, long delay, long period) Schedules a sync repeating task to run laterstatic Task
syncRepeating
(Consumer<Task> run, long delay, long period) Schedules a sync repeating task to run laterstatic Task
syncRepeating
(org.bukkit.plugin.Plugin plugin, Runnable run, long delay, long period) Schedules a sync repeating task to run laterstatic Task
syncRepeating
(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
-