Package com.marcusslover.plus.lib.task
Class Task
java.lang.Object
com.marcusslover.plus.lib.task.Task
Simple utility for Bukkit scheduler tasks, essentially just shorthand
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic TaskasyncDelayed(long delay, Runnable run) Deprecated.static TaskasyncDelayed(long delay, Consumer<Task> run) Deprecated.static TaskasyncDelayed(Runnable run) Deprecated.static TaskasyncDelayed(Consumer<Task> run) Deprecated.static TaskasyncDelayed(org.bukkit.plugin.Plugin plugin, long delay, Runnable run) Schedules an async delayed task to run after a delaystatic TaskasyncDelayed(org.bukkit.plugin.Plugin plugin, long delay, Consumer<Task> run) Deprecated.static 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, Consumer<Task> run) Schedules an async delayed task to run as soon as possiblestatic TaskasyncRepeating(long delay, long period, Runnable run) Deprecated.static TaskasyncRepeating(long delay, long period, Consumer<Task> run) Deprecated.static TaskasyncRepeating(org.bukkit.plugin.Plugin plugin, long delay, long period, Runnable run) Schedules an async repeating task to run laterstatic TaskasyncRepeating(org.bukkit.plugin.Plugin plugin, long delay, long period, Consumer<Task> run) Deprecated, for removal: This API element is subject to removal in a future version.voidcancel()Cancels this task, same asBukkitScheduler.cancelTask(int)booleanbooleanisQueued()static TasksyncDelayed(long delay, Runnable run) Deprecated.static TasksyncDelayed(long delay, Consumer<Task> run) Deprecated.static TasksyncDelayed(Runnable run) Deprecated.static TasksyncDelayed(Consumer<Task> run) Deprecated.static TasksyncDelayed(org.bukkit.plugin.Plugin plugin, long delay, Runnable run) Schedules a sync delayed task to run after a delaystatic TasksyncDelayed(org.bukkit.plugin.Plugin plugin, long delay, Consumer<Task> run) 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, Consumer<Task> run) Schedules a sync delayed task to run as soon as possiblestatic TasksyncRepeating(long delay, long period, Runnable run) Deprecated.static TasksyncRepeating(long delay, long period, Consumer<Task> run) Deprecated.static TasksyncRepeating(org.bukkit.plugin.Plugin plugin, long delay, long period, Runnable run) Schedules a sync repeating task to run laterstatic TasksyncRepeating(org.bukkit.plugin.Plugin plugin, long delay, long period, Consumer<Task> run) Schedules a sync repeating task to run later
-
Method Details
-
syncDelayed
Deprecated.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 - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
syncDelayed
Deprecated.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 - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
syncDelayed
Deprecated.Schedules a sync delayed task to run after a delay- Parameters:
delay- The delay in ticks to wait before running 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:
plugin- The plugin scheduling the taskdelay- The delay in ticks to wait before running the taskrun- The task to run - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
syncDelayed
Deprecated.Schedules a sync delayed task to run after a delay- Parameters:
delay- The delay in ticks to wait before running 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:
plugin- The plugin scheduling the taskdelay- The delay in ticks to wait before running the taskrun- The task to run - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
syncRepeating
Deprecated.Schedules a sync repeating task to run later- Parameters:
delay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the taskrun- The task to run - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
syncRepeating
public static Task syncRepeating(org.bukkit.plugin.Plugin plugin, long delay, long period, Runnable run) Schedules a sync repeating task to run later- Parameters:
plugin- The plugin scheduling the taskdelay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the taskrun- The task to run - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
syncRepeating
Deprecated.Schedules a sync repeating task to run later- Parameters:
delay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the taskrun- The task to run - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
syncRepeating
public static Task syncRepeating(org.bukkit.plugin.Plugin plugin, long delay, long period, Consumer<Task> run) Schedules a sync repeating task to run later- Parameters:
plugin- The plugin scheduling the taskdelay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the taskrun- The task to run - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
asyncDelayed
Deprecated.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 - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
asyncDelayed
Deprecated.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 - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
asyncDelayed
Deprecated.Schedules an async delayed task to run after a delay- Parameters:
delay- The delay in ticks to wait before running 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:
plugin- The plugin scheduling the taskdelay- The delay in ticks to wait before running the taskrun- The task to run - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
asyncDelayed
Deprecated.Schedules an async delayed task to run after a delay- Parameters:
delay- The delay in ticks to wait before running the taskrun- The task to run- Returns:
- The Task that has been scheduled
-
asyncDelayed
@Deprecated public static Task asyncDelayed(org.bukkit.plugin.Plugin plugin, long delay, Consumer<Task> run) Deprecated.Schedules an async delayed task to run after a delay- Parameters:
plugin- The plugin scheduling the taskdelay- The delay in ticks to wait before running the taskrun- The task to run - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
asyncRepeating
Deprecated.Schedules an async repeating task to run later- Parameters:
delay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the taskrun- The task to run - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
asyncRepeating
@Deprecated(forRemoval=true) public static Task asyncRepeating(org.bukkit.plugin.Plugin plugin, long delay, long period, Consumer<Task> run) Deprecated, for removal: This API element is subject to removal in a future version.Schedules an async repeating task to run later- Parameters:
plugin- The plugin scheduling the taskdelay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the taskrun- The task to run - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
asyncRepeating
Deprecated.Schedules an async repeating task to run later- Parameters:
delay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the taskrun- The task to run - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
asyncRepeating
public static Task asyncRepeating(org.bukkit.plugin.Plugin plugin, long delay, long period, Runnable run) Schedules an async repeating task to run later- Parameters:
plugin- The plugin scheduling the taskdelay- The delay in ticks to wait before running the taskperiod- The number of ticks between executions of the taskrun- The task to run - Do not use bukkit runnable. (Cancelling the bukkit runnable will not cancel the created task)- Returns:
- The Task that has been scheduled
-
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)
-