Constructors

Link copied to clipboard
constructor(plugin: SpigotPlugin)

Properties

Link copied to clipboard

Controls if this task can currently tick, decrease the countdown and call the onTick lifecycle function.

Link copied to clipboard

The current countdown of this task.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The internal task that runs to decrease the countdown and call the onTick lifecycle function. This field will be null if this task is currently not running.

Link copied to clipboard

Checks if this task is currently running.

Link copied to clipboard

The internal task that's runs the runnable to decrease the countdown and call the onTick lifecycle function. This field will be null if this task is currently not running.

Functions

Link copied to clipboard
open override fun cancelRunnable()

Cancels the internal runnable for this task.

Link copied to clipboard
open override fun cancelTask()

Cancels the internal task for this task.

Link copied to clipboard
open override fun createRunnable(): SpigotRunnable

Creates the internal runnable for this task.

Link copied to clipboard
open override fun createTask(): SpigotTask

Creates the internal runnable for this task.

Link copied to clipboard
open fun <T : Annotation> getInfo(type: Class<T>): T
Link copied to clipboard

Handles a single tick of this task, decreases the countdown and calls the onTick lifecycle function.

Link copied to clipboard
open fun onExpire()

Lifecycle function; called when this task's countdown reaches 0.

Link copied to clipboard
open fun onReset()

Lifecycle function; called when this task is reset via reset.

Link copied to clipboard
open fun onRestart()

Lifecycle function; called when this task is restarted via restart.

Link copied to clipboard
open fun onStart()

Lifecycle function; called when this task is started.

Link copied to clipboard
open fun onStop()

Lifecycle function; called when this task is stopped.

Link copied to clipboard
open fun onTick()

Lifecycle function; called when this task is ticked. This task will only tick if allowTick is true.

Link copied to clipboard
fun reset()

Resets this task by setting the countdown to its initial value defined in Info and calls the onReset lifecycle function.

Link copied to clipboard
fun restart()

Restarts this task by stopping it via stop, resetting it's countdown via reset, starting the task again via start and finally calling the onRestart lifecycle function.

Link copied to clipboard
fun start()

Starts this task if It's not already running. This function will call createRunnable and createTask to set up this task before starting the internal tick timer. The onStart lifecycle function will be called after this task is ready for execution.

Link copied to clipboard
fun stop()

Stops this task if It's currently running. This function stops and cleans up the internal runnable and task and then calls the onStop lifecycle function.