Package fr.maxlego08.menu.api.scheduler
Interface ZScheduler
public interface ZScheduler
The ZScheduler interface provides methods for managing tasks and working with Folia.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels the task.Runs the task.Runs the task asynchronously.runTaskLater(org.bukkit.Location location, long delay, Runnable task) Runs the task after a specified number of ticks.runTaskLaterAsynchronously(long delay, Runnable task) Runs the task asynchronously after a specified number of ticks.runTaskTimer(org.bukkit.Location location, long delay, long period, Runnable task) Runs the task repeatedly on a timer.runTaskTimerAsynchronously(long delay, long period, Runnable task) Runs the task repeatedly on a timer asynchronously.
-
Field Details
-
TIMER
The default timer used for scheduling tasks.
-
-
Method Details
-
runTask
Runs the task.- Parameters:
location- Required for Folia, in Bukkit can be null.task- The task to run.- Returns:
- The created
ZScheduler.
-
runTaskAsynchronously
Runs the task asynchronously.- Parameters:
task- The task to run.- Returns:
- The created
ZScheduler.
-
runTaskLater
Runs the task after a specified number of ticks.- Parameters:
location- Required for Folia, in Bukkit can be null.task- The task to run.delay- The number of ticks to wait.- Returns:
- The created
ZScheduler.
-
runTaskLaterAsynchronously
Runs the task asynchronously after a specified number of ticks.- Parameters:
task- The task to run.delay- The number of ticks to wait.- Returns:
- The created
ZScheduler.
-
runTaskTimer
ZScheduler runTaskTimer(@Nullable org.bukkit.Location location, long delay, long period, Runnable task) Runs the task repeatedly on a timer.- Parameters:
location- Required for Folia, in Bukkit can be null.task- The task to run.delay- The delay before the task is first run (in ticks).period- The ticks elapsed before the task is run again.- Returns:
- The created
ZScheduler.
-
runTaskTimerAsynchronously
Runs the task repeatedly on a timer asynchronously.- Parameters:
task- The task to run.delay- The delay before the task is first run (in ticks).period- The ticks elapsed before the task is run again.- Returns:
- The created
ZScheduler.
-
cancel
void cancel()Cancels the task.
-