boxlin / io.opencubes.boxlin.adapter / BoxlinContext / addListener

addListener

inline fun <reified E : Event> addListener(priority: EventPriority = EventPriority.NORMAL, receiveCanceled: Boolean = false, noinline listener: (E) -> Unit): Unit

Add a event listener to the mod event bus.

Parameters

E - The type of events this listener will receive.

priority - The how highly prioritised is this event listener to run.

receiveCanceled - Should this listener receive canceled events.

listener - The event listener function that will be called.

fun <E : Event> addListener(eventClass: Class<E>, priority: EventPriority = EventPriority.NORMAL, receiveCanceled: Boolean = false, listener: (E) -> Unit): Unit

Add a event listener to the mod event bus.

Parameters

E - The type of events this listener will receive.

eventClass - The event type class.

priority - The how highly prioritised is this event listener to run.

receiveCanceled - Should this listener receive canceled events.

listener - The event listener function that will be called.