SingleListener

abstract class SingleListener<T : Event>(val priority: EventPriority = EventPriority.NORMAL, val ignoreCancelled: Boolean = false) : Listener

This class represents a Listener with only one event to listen to.

Constructors

Link copied to clipboard
constructor(priority: EventPriority = EventPriority.NORMAL, ignoreCancelled: Boolean = false)

Properties

Link copied to clipboard
Link copied to clipboard
val priority: EventPriority

Functions

Link copied to clipboard
abstract fun T.onEvent()
Link copied to clipboard
inline fun <T : Event> SingleListener<T>.register()

Registers the SingleListener with its event listener.

inline fun Listener.register()
fun Listener.register(plugin: Plugin)
fun <T : Event> SingleListener<T>.register(plugin: Plugin, eventClass: KClass<T>)
fun <T : Event> Listener.register(plugin: Plugin, eventClass: KClass<T>, priority: EventPriority = EventPriority.NORMAL, ignoreCancelled: Boolean = false, executor: (Listener, Event) -> Unit)

inline fun <T : Event> Listener.register(priority: EventPriority = EventPriority.NORMAL, ignoreCancelled: Boolean = false, noinline executor: (Listener, Event) -> Unit)

Registers the event with a custom event executor.

Link copied to clipboard
fun Listener.unregister()

Shortcut for unregistering all events in this listener.