registerSuspend
Registers an event listener with suspending functions. Does exactly the same thing as server.getEventManager().register but makes suspension functions possible. Example:
class MyListener { @Subscribe suspend fun onLoginEvent(event: PostLoginEvent) {
}
Content copied to clipboard
}
Parameters
listener
Velocity Listener.
plugin
Velocity Plugin.
fun <E> <Error class: unknown class>.registerSuspend(plugin: Any, eventClass: Class<E>, handler: suspend (handler: E) -> Unit)
Registers a new event listener with a functional style listener.
Parameters
plugin
Velocity Plugin.
eventClass
Velocity Event class
handler
suspend invocation
fun <E> <Error class: unknown class>.registerSuspend( plugin: Any, eventClass: Class<E>, postOrder: <Error class: unknown class>, handler: suspend (handler: E) -> Unit)
Registers a new event listener with a functional style listener.
Parameters
plugin
Velocity Plugin.
eventClass
Velocity Event class
postOrder
postOrder parameter,
handler
suspend invocation
fun <Error class: unknown class>.registerSuspend(meta: <Error class: unknown class>, command: SuspendingSimpleCommand, plugin: Any)
Registers an command executor with suspending function. Does exactly the same as CommandManager.register
Parameters
meta
CommandMeta.
plugin
Velocity Plugin.
command
SuspendingCommand.