Fixed disconnection reason display due to outdated client version (#1259)

This commit is contained in:
Maxim Breitman
2024-02-29 22:41:05 +03:00
committed by GitHub
parent d330236b09
commit af09677f60

View File

@@ -118,6 +118,8 @@ public class HandshakeSessionHandler implements MinecraftSessionHandler {
private void handleLogin(HandshakePacket handshake, InitialInboundConnection ic) {
if (!ProtocolVersion.isSupported(handshake.getProtocolVersion())) {
// Bump connection into correct protocol state so that we can send the disconnect packet.
connection.setState(StateRegistry.LOGIN);
ic.disconnectQuietly(Component.translatable()
.key("multiplayer.disconnect.outdated_client")
.arguments(Component.text(ProtocolVersion.SUPPORTED_VERSION_STRING))