Class RepeatingTask
java.lang.Object
org.bukkit.scheduler.BukkitRunnable
dev.magicmq.pyspigot.manager.task.Task
dev.magicmq.pyspigot.manager.task.RepeatingTask
- All Implemented Interfaces:
Runnable
Represents a repeating task defined by a script.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRepeatingTask
(Script script, PyFunction function, Object[] functionArgs, boolean async, long delay, long interval) -
Method Summary
Methods inherited from class org.bukkit.scheduler.BukkitRunnable
cancel, getTaskId, isCancelled, runTask, runTaskAsynchronously, runTaskLater, runTaskLaterAsynchronously, runTaskTimer, runTaskTimerAsynchronously
-
Constructor Details
-
RepeatingTask
public RepeatingTask(Script script, PyFunction function, Object[] functionArgs, boolean async, long delay, long interval) - Parameters:
script
- The script associated with this repeating taskfunction
- The script function that should be called every time the repeating task executesfunctionArgs
- Any arguments that should be passed to the functionasync
- True if the task is asynchronous, false if otherwisedelay
- The delay, in ticks, to wait until running the taskinterval
- The interval, in ticks, between each repeat of the task
-
-
Method Details
-
run
public void run()Called internally when the task executes. -
toString
Prints a representation of this RepeatingTask in string format, including the task ID, if it is async, delay (if applicable), and interval (if applicable)
-