From af09677f603af3cdd12bc773dc3c6f93e44ffea2 Mon Sep 17 00:00:00 2001 From: Maxim Breitman <89523915+maximbreitman@users.noreply.github.com> Date: Thu, 29 Feb 2024 22:41:05 +0300 Subject: [PATCH] Fixed disconnection reason display due to outdated client version (#1259) --- .../proxy/connection/client/HandshakeSessionHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandler.java index 4ba17624..3948d087 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandler.java @@ -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))