Constructors

Link copied to clipboard
constructor(plugin: SpigotPlugin)

Properties

Link copied to clipboard

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

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

The internal task that runs to 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 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 and calls the onTick lifecycle function. If ticks are disabled by allowTick, this function does nothing.

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 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.