Class DisconnectedEvent
java.lang.Object
org.geysermc.mcprotocollib.network.event.session.DisconnectedEvent
- All Implemented Interfaces:
SessionEvent
Called when the session is disconnected.
-
Constructor Summary
ConstructorsConstructorDescriptionDisconnectedEvent(Session session, net.kyori.adventure.text.Component reason, Throwable cause) Creates a new DisconnectedEvent instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidcall(SessionListener listener) Calls the event.getCause()Gets the Throwable responsible for the session disconnecting.net.kyori.adventure.text.ComponentGets the reason given for the session disconnecting.Gets the session involved in this event.
-
Constructor Details
-
DisconnectedEvent
public DisconnectedEvent(Session session, net.kyori.adventure.text.Component reason, Throwable cause) Creates a new DisconnectedEvent instance.- Parameters:
session- Session being disconnected.reason- Reason for the session to disconnect.cause- Throwable that caused the disconnect.
-
-
Method Details
-
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
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
Description copied from interface:SessionEventCalls the event.- Specified by:
callin interfaceSessionEvent- Parameters:
listener- Listener to call the event on.
-