Package com.craftmend.openaudiomc.api
Interface EventApi
public interface EventApi
This is the event api, which is used to register and call events.
We use this instead of the bukkit event system to allow for cross-platform compatibility
-
Method Summary
Modifier and TypeMethodDescriptionCall an eventstatic EventApi
Get an instance of the event api.<T extends BaseEvent>
voidregisterHandler
(Class<T> event, SingleHandler<T> handler) Register a handler for a specific eventvoid
registerHandlers
(Object listener) Register a listener for events annotated with @Handlervoid
unregisterHandlers
(Object listener) Unregister a listener for events annotated with @Handler
-
Method Details
-
getInstance
Get an instance of the event api. May be null if the plugin is not loaded yet- Returns:
- instance
-
registerHandlers
Register a listener for events annotated with @Handler- Parameters:
listener
- the listener to register
-
unregisterHandlers
Unregister a listener for events annotated with @Handler- Parameters:
listener
- the listener to unregister
-
callEvent
Call an event- Parameters:
event
- the event to call
-
registerHandler
Register a handler for a specific event- Type Parameters:
T
- the event type- Parameters:
event
- the event to listen forhandler
- the handler to call
-