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
    Modifier and Type
    Interface
    Description
    static enum 
    The order listeners run in.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether a listener has vetoed this event.
    <T extends Event>
    T
    withCancelled(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

      <T extends Event> T withCancelled(boolean cancelled)
      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