Package net.minecraft.server.network
Class ServerQueryNetworkHandler
java.lang.Object
net.minecraft.server.network.ServerQueryNetworkHandler
- All Implemented Interfaces:
PacketListener,ServerQueryPacketListener
public class ServerQueryNetworkHandler extends Object implements ServerQueryPacketListener
-
Field Summary
Fields Modifier and Type Field Description private ClientConnectionconnectionprivate static TextREQUEST_HANDLEDprivate booleanresponseSentprivate MinecraftServerserver -
Constructor Summary
Constructors Constructor Description ServerQueryNetworkHandler(MinecraftServer server, ClientConnection connection) -
Method Summary
Modifier and Type Method Description ClientConnectiongetConnection()Returns the connection this packet listener intends to listen to.voidonDisconnected(Text reason)Called when the connection this listener listens to has disconnected.voidonPing(QueryPingC2SPacket packet)voidonRequest(QueryRequestC2SPacket packet)
-
Field Details
-
REQUEST_HANDLED
-
server
-
connection
-
responseSent
private boolean responseSent
-
-
Constructor Details
-
ServerQueryNetworkHandler
-
-
Method Details
-
onDisconnected
Called when the connection this listener listens to has disconnected. Can be used to display the disconnection reason.- Specified by:
onDisconnectedin interfacePacketListener- Parameters:
reason- the reason of disconnection; may be a generic message
-
getConnection
Returns the connection this packet listener intends to listen to.- Specified by:
getConnectionin interfacePacketListener- See Also:
ClientConnection.getPacketListener()
-
onRequest
- Specified by:
onRequestin interfaceServerQueryPacketListener
-
onPing
- Specified by:
onPingin interfaceServerQueryPacketListener
-