Package com.griefdefender.api.scheduler
Interface Scheduler
public interface Scheduler
Represents a scheduler for executing tasks.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanSchedules a task to run on next tick.booleanSchedules a task to run on next tick.runTaskAsynchronously(Object plugin, Object sender, Runnable runnable) Schedules a task to run on next tick asynchronously.runTaskAsynchronously(Object plugin, Runnable runnable) Schedules a task to run on next tick asynchronously.runTaskLater(Object plugin, Object sender, Runnable runnable, long delay) Schedules a task that will run after the specified number of ticks.runTaskLater(Object plugin, Runnable runnable, long delay) Schedules a task that will run after the specified number of ticks.runTaskLaterAsynchronously(Object plugin, Object sender, Runnable runnable, long delay) Schedules a task that will run asynchronously after the specified number of ticks.runTaskLaterAsynchronously(Object plugin, Runnable runnable, long delay) Schedules a task that will run asynchronously after the specified number of ticks.runTaskTimer(Object plugin, Object sender, Runnable runnable, long delay, long period) Schedules a repeating task that will run until cancelled, starting after the specified number of server ticks.runTaskTimer(Object plugin, Runnable runnable, long delay, long period) Schedules a repeating task that will run until cancelled, starting after the specified number of server ticks.
-
Method Details
-
runTask
Schedules a task to run on next tick.- Parameters:
plugin- The reference to the plugin scheduling taskrunnable- The runnable to execute- Returns:
- true if success, false if not
- Throws:
IllegalArgumentException
-
runTask
Schedules a task to run on next tick.- Parameters:
plugin- The reference to the plugin scheduling tasksender- The command senderrunnable- The runnable to execute- Returns:
- true if success, false if not
- Throws:
IllegalArgumentException
-
runTaskAsynchronously
Schedules a task to run on next tick asynchronously.- Parameters:
plugin- The reference to the plugin scheduling taskrunnable- The runnable to execute- Returns:
- The scheduled task
- Throws:
IllegalArgumentException
-
runTaskAsynchronously
Task runTaskAsynchronously(Object plugin, Object sender, Runnable runnable) throws IllegalArgumentException Schedules a task to run on next tick asynchronously.- Parameters:
plugin- The reference to the plugin scheduling tasksender- The command senderrunnable- The runnable to execute- Returns:
- The scheduled task
- Throws:
IllegalArgumentException
-
runTaskLater
Schedules a task that will run after the specified number of ticks.- Parameters:
plugin- the reference to the plugin scheduling taskrunnable- The runnable to executedelay- the ticks to wait before running the task- Returns:
- The scheduled task
- Throws:
IllegalArgumentException
-
runTaskLater
Task runTaskLater(Object plugin, Object sender, Runnable runnable, long delay) throws IllegalArgumentException Schedules a task that will run after the specified number of ticks.- Parameters:
plugin- The reference to the plugin scheduling tasksender- The command senderrunnable- The runnable to executedelay- The ticks to wait before running the task- Returns:
- The scheduled task
- Throws:
IllegalArgumentException
-
runTaskLaterAsynchronously
Task runTaskLaterAsynchronously(Object plugin, Runnable runnable, long delay) throws IllegalArgumentException Schedules a task that will run asynchronously after the specified number of ticks.- Parameters:
plugin- The reference to the plugin scheduling taskrunnable- The runnable to executedelay- The ticks to wait before running the task- Returns:
- The scheduled task
- Throws:
IllegalArgumentException
-
runTaskLaterAsynchronously
Task runTaskLaterAsynchronously(Object plugin, Object sender, Runnable runnable, long delay) throws IllegalArgumentException Schedules a task that will run asynchronously after the specified number of ticks.- Parameters:
plugin- The reference to the plugin scheduling tasksender- The command senderrunnable- The runnable to executedelay- The ticks to wait before running the task- Returns:
- The scheduled task
- Throws:
IllegalArgumentException
-
runTaskTimer
Task runTaskTimer(Object plugin, Runnable runnable, long delay, long period) throws IllegalArgumentException Schedules a repeating task that will run until cancelled, starting after the specified number of server ticks.- Parameters:
plugin- The reference to the plugin scheduling taskrunnable- The runnable to executedelay- The ticks to wait before running the taskperiod- The ticks to wait between runs- Throws:
IllegalArgumentException
-
runTaskTimer
Task runTaskTimer(Object plugin, Object sender, Runnable runnable, long delay, long period) throws IllegalArgumentException Schedules a repeating task that will run until cancelled, starting after the specified number of server ticks.- Parameters:
plugin- The reference to the plugin scheduling tasksender- The command senderrunnable- The runnable to executedelay- The ticks to wait before running the taskperiod- The ticks to wait between runs- Throws:
IllegalArgumentException
-