GlobalEventNode

The root node of the server's event node tree.

This is used to distinguish it from regular event nodes, to allow it to be injected in to plugins that want to inject it in the same way as the event manager could be injected.

Functions

Link copied to clipboard
abstract fun addChild(node: EventNode<out Event>)

Adds the given node as a child of this event node.

Link copied to clipboard
abstract fun <E : Event> fire(event: E): E

Fires the given event on this event node.

Link copied to clipboard
abstract fun hasListener(type: Class<out Event>): Boolean

Checks if this event node has a listener for the given event type.

Link copied to clipboard
abstract fun registerListener(listener: EventListener<out Event>)

Registers the given event listener to this event node.

open fun <E : Event> registerListener(eventType: Class<E>, handler: Consumer<E>)

Registers an event listener for the given eventType to this event node, calling the given handler when the event is fired.

Link copied to clipboard
inline fun <T : Event, E : T> EventNode<T>.registerListener(handler: Consumer<E>)

Registers an event listener for the given event type T to this event node, calling the given handler when the event is fired.

Link copied to clipboard
abstract fun registerListeners(listenerClass: Any)

Registers all event listeners in the given listenerClass to this event node.

Link copied to clipboard
abstract fun removeChild(node: EventNode<out Event>)

Removes the given node as a child of this event node.

Link copied to clipboard
abstract fun unregisterListener(listener: EventListener<out Event>)

Unregisters the given event listener from this event node, meaning it will not be called when an event that it listens for is fired.

Link copied to clipboard
abstract fun unregisterListeners(listenerClass: Any)

Unregisters all listeners in the given listenerClass from this event node.

Properties

Link copied to clipboard
abstract val children: Set<EventNode<Event>>

The children of this node.

Link copied to clipboard
abstract val eventType: Class<Event>

The type of events this node can have listeners for.

Link copied to clipboard
abstract val name: String

The name of this node.

Link copied to clipboard
abstract val parent: EventNode<in Event>?

The parent of this node.

Link copied to clipboard
abstract var priority: Int

The priority of this node.