Package net.minecraft.client.network
Class ClientLoginNetworkHandler
java.lang.Object
net.minecraft.client.network.ClientLoginNetworkHandler
- All Implemented Interfaces:
ClientLoginPacketListener,PacketListener
@Environment(CLIENT) public class ClientLoginNetworkHandler extends Object implements ClientLoginPacketListener
-
Field Summary
Fields Modifier and Type Field Description private MinecraftClientclientprivate ClientConnectionconnectionprivate static LoggerLOGGERprivate ScreenparentScreenprivate com.mojang.authlib.GameProfileprofileprivate Consumer<Text>statusConsumer -
Constructor Summary
Constructors Constructor Description ClientLoginNetworkHandler(ClientConnection connection, MinecraftClient client, Screen parentGui, Consumer<Text> statusConsumer) -
Method Summary
Modifier and Type Method Description ClientConnectiongetConnection()Returns the connection this packet listener intends to listen to.private com.mojang.authlib.minecraft.MinecraftSessionServicegetSessionService()private TextjoinServerSession(String serverId)voidonCompression(LoginCompressionS2CPacket packet)voidonDisconnect(LoginDisconnectS2CPacket packet)voidonDisconnected(Text reason)Called when the connection this listener listens to has disconnected.voidonHello(LoginHelloS2CPacket packet)voidonLoginSuccess(LoginSuccessS2CPacket packet)voidonQueryRequest(LoginQueryRequestS2CPacket packet)
-
Field Details
-
LOGGER
-
client
-
parentScreen
-
statusConsumer
-
connection
-
profile
private com.mojang.authlib.GameProfile profile
-
-
Constructor Details
-
ClientLoginNetworkHandler
public ClientLoginNetworkHandler(ClientConnection connection, MinecraftClient client, @Nullable Screen parentGui, Consumer<Text> statusConsumer)
-
-
Method Details
-
onHello
- Specified by:
onHelloin interfaceClientLoginPacketListener
-
joinServerSession
-
getSessionService
private com.mojang.authlib.minecraft.MinecraftSessionService getSessionService() -
onLoginSuccess
- Specified by:
onLoginSuccessin interfaceClientLoginPacketListener
-
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()
-
onDisconnect
- Specified by:
onDisconnectin interfaceClientLoginPacketListener
-
onCompression
- Specified by:
onCompressionin interfaceClientLoginPacketListener
-
onQueryRequest
- Specified by:
onQueryRequestin interfaceClientLoginPacketListener
-