Interface EventDispatcher
public interface EventDispatcher
Hands an event to the registered listeners, in priority order, and returns whatever they made of it.
-
Method Summary
Modifier and TypeMethodDescription<T extends Event>
Tdispatch(Map<Event.Priority, List<UnaryOperator<Event>>> listeners, T event) Runs an event through an explicit set of listeners, used to replay listeners captured before a reload.<T extends Event>
Tdispatch(T event) Runs an event through every registered listener.
-
Method Details
-
dispatch
Runs an event through an explicit set of listeners, used to replay listeners captured before a reload.- Type Parameters:
T- the event type- Parameters:
listeners- the listeners to run, grouped by priorityevent- the event- Returns:
- the event as the listeners left it
-
dispatch
Runs an event through every registered listener.- Type Parameters:
T- the event type- Parameters:
event- the event- Returns:
- the event as the listeners left it
-