Class DisconnectingEvent

java.lang.Object
org.geysermc.mcprotocollib.network.event.session.DisconnectingEvent
All Implemented Interfaces:
SessionEvent

public class DisconnectingEvent extends Object implements SessionEvent
Called when the session is about to disconnect.
  • Constructor Details

    • DisconnectingEvent

      public DisconnectingEvent(Session session, net.kyori.adventure.text.Component reason, Throwable cause)
      Creates a new DisconnectingEvent instance.
      Parameters:
      session - Session being disconnected.
      reason - Reason for the session to disconnect.
      cause - Throwable that caused the disconnect.
  • Method Details

    • getSession

      public Session getSession()
      Gets the session involved in this event.
      Returns:
      The event's session.
    • getReason

      public net.kyori.adventure.text.Component getReason()
      Gets the reason given for the session disconnecting.
      Returns:
      The event's reason.
    • getCause

      public Throwable getCause()
      Gets the Throwable responsible for the session disconnecting.
      Returns:
      The Throwable responsible for the disconnect, or null if the disconnect was not caused by a Throwable.
    • call

      public void call(SessionListener listener)
      Description copied from interface: SessionEvent
      Calls the event.
      Specified by:
      call in interface SessionEvent
      Parameters:
      listener - Listener to call the event on.