Interface Event
- All Known Subinterfaces:
ModuleEvent, PlayerEvent
- All Known Implementing Classes:
DisableEvent, EnableEvent, MessageFormattingEvent, MessagePrepareEvent, MessageReceiveEvent, MessageSendEvent, ModuleDisableEvent, ModuleEnableEvent, PlayerJoinEvent, PlayerLoadEvent, PlayerPersistAndDisposeEvent, PlayerPreLoginEvent, PlayerQuitEvent, ProxyMessageEvent, ReloadEvent, StatusResponseEvent
public interface Event
Something that happened inside FlectonePulse and that a listener may inspect or veto.
Events are immutable records; a listener that wants to change one returns a modified copy.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether a listener has vetoed this event.<T extends Event>
TwithCancelled(boolean cancelled) Returns a copy of this event with the cancelled flag set.
-
Method Details
-
cancelled
boolean cancelled()Whether a listener has vetoed this event. A cancelled event stops before its side effect runs.- Returns:
- true if the event was cancelled
-
withCancelled
Returns a copy of this event with the cancelled flag set.- Type Parameters:
T- the concrete event type- Parameters:
cancelled- the new cancelled state- Returns:
- a copy carrying the new state
-