Package emu.grasscutter.server.event
Class EventHandler<T extends Event>
java.lang.Object
emu.grasscutter.server.event.EventHandler<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the callback for the handler.Returns the handler's priority.handles()Gets which event this handler is handling.ignore(boolean ignore) Sets if the handler will ignore cancelled events.booleanReturns if the handler will ignore cancelled events.listener(EventConsumer<T> listener) Sets the callback method for when the event is invoked.priority(HandlerPriority priority) Changes the handler's priority in handling events.voidregister()Registers the handler into the PluginManager.
-
Constructor Details
-
EventHandler
-
-
Method Details
-
handles
Gets which event this handler is handling.- Returns:
- An event class.
-
getCallback
Returns the callback for the handler.- Returns:
- A consumer callback.
-
getPriority
Returns the handler's priority.- Returns:
- The priority of the handler.
-
ignoresCanceled
public boolean ignoresCanceled()Returns if the handler will ignore cancelled events.- Returns:
- The ignore cancelled state.
-
listener
Sets the callback method for when the event is invoked.- Parameters:
listener- An event handler method.- Returns:
- Method chaining.
-
priority
Changes the handler's priority in handling events.- Parameters:
priority- The priority of the handler.- Returns:
- Method chaining.
-
ignore
Sets if the handler will ignore cancelled events.- Parameters:
ignore- If the handler should ignore cancelled events.- Returns:
- Method chaining.
-
register
public void register()Registers the handler into the PluginManager.
-