Package eu.sculkpowered.server.event
Interface EventHandler
public interface EventHandler
Handles the registration and execution of events.
-
Method Summary
Modifier and TypeMethodDescription<E> CompletableFuture<E> call(E event) Calls the event.<E> voidjustCall(E event) Calls the event.<E> voidregister(@NotNull Plugin plugin, @NotNull Class<E> event, short eventOrder, @NotNull Consumer<E> eventConsumer) Registers an event listener consumer.default <E> voidRegisters an event listener consumer.voidRegisters the event listener.voidunregister(@NotNull Plugin plugin) Unregisters all listeners of a specific pluginvoidunregister(@NotNull Plugin plugin, @NotNull Object listener) Unregisters the specified listener.
-
Method Details
-
register
Registers the event listener.- Parameters:
plugin- the plugin that registers the event listenerlistener- the listener- Since:
- 1.0.0
-
register
default <E> void register(@NotNull @NotNull Plugin plugin, @NotNull @NotNull Class<E> event, @NotNull @NotNull Consumer<E> eventConsumer) Registers an event listener consumer.- Type Parameters:
E- the event class type- Parameters:
plugin- the plugin that registers the event listenerevent- the event classeventConsumer- the consumer that consumes the event on call- Since:
- 1.0.0
-
register
<E> void register(@NotNull @NotNull Plugin plugin, @NotNull @NotNull Class<E> event, short eventOrder, @NotNull @NotNull Consumer<E> eventConsumer) Registers an event listener consumer.- Type Parameters:
E- the event class type- Parameters:
plugin- the plugin that registers the event listenerevent- the event classeventOrder- the ordereventConsumer- the consumer that consumes the event on call- Since:
- 1.0.0
-
unregister
Unregisters all listeners of a specific plugin- Parameters:
plugin- the plugin of the listeners- Since:
- 1.0.0
-
unregister
Unregisters the specified listener.- Parameters:
plugin- the plugin of the listenerlistener- the listener to unregister- Since:
- 1.0.0
-
call
Calls the event.- Type Parameters:
E- the event type to call- Parameters:
event- the event to call- Returns:
- a
CompletableFuturewith the called event. - Since:
- 1.0.0
-
justCall
<E> void justCall(E event) Calls the event.- Type Parameters:
E- the event type to call- Parameters:
event- the event to call- Since:
- 1.0.0
-