Class ServerListener
java.lang.Object
org.geysermc.mcprotocollib.network.event.session.SessionAdapter
org.geysermc.mcprotocollib.protocol.ServerListener
- All Implemented Interfaces:
SessionListener
Handles initial login and status requests for servers.
-
Constructor Summary
ConstructorsConstructorDescriptionServerListener(com.viaversion.nbt.tag.CompoundTag networkCodec, com.viaversion.nbt.tag.CompoundTag networkTags) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when a session connects.voiddisconnecting(Session session, net.kyori.adventure.text.Component reason, Throwable cause) Called when a session is about to disconnect.booleanvoidpacketReceived(Session session, Packet packet) Called when a session receives a packet.Methods inherited from class SessionAdapter
disconnected, packetError, packetSending, packetSent
-
Constructor Details
-
ServerListener
public ServerListener(com.viaversion.nbt.tag.CompoundTag networkCodec, com.viaversion.nbt.tag.CompoundTag networkTags)
-
-
Method Details
-
connected
Description copied from interface:SessionListenerCalled when a session connects.- Specified by:
connectedin interfaceSessionListener- Overrides:
connectedin classSessionAdapter- Parameters:
session- Session that connected.
-
packetReceived
Description copied from interface:SessionListenerCalled when a session receives a packet.- Specified by:
packetReceivedin interfaceSessionListener- Overrides:
packetReceivedin classSessionAdapter- Parameters:
packet- the packet that was just received.
-
disconnecting
public void disconnecting(Session session, net.kyori.adventure.text.Component reason, Throwable cause) Description copied from interface:SessionListenerCalled when a session is about to disconnect.- Specified by:
disconnectingin interfaceSessionListener- Overrides:
disconnectingin classSessionAdapter- Parameters:
session- Session being disconnected.reason- Reason for the session to disconnect.cause- Throwable that caused the disconnect, or null if not caused by a throwable.
-
isTransfer
public boolean isTransfer()
-