From 67c65e04647f60021bc7d884e11c27a350290378 Mon Sep 17 00:00:00 2001 From: Outfluencer <48880402+Outfluencer@users.noreply.github.com> Date: Fri, 19 Apr 2024 06:58:16 +1000 Subject: [PATCH] #3658: Minecraft 1.20.5-rc1 support --- .../net/md_5/bungee/protocol/ProtocolConstants.java | 2 +- .../net/md_5/bungee/protocol/packet/LoginSuccess.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java index 182614c4..9b3fb584 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java @@ -45,7 +45,7 @@ public class ProtocolConstants public static final int MINECRAFT_1_20 = 763; public static final int MINECRAFT_1_20_2 = 764; public static final int MINECRAFT_1_20_3 = 765; - public static final int MINECRAFT_1_20_5 = 1073742011; + public static final int MINECRAFT_1_20_5 = 1073742013; public static final List SUPPORTED_VERSIONS; public static final List SUPPORTED_VERSION_IDS; diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java index 07fb3d79..60ff5700 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/LoginSuccess.java @@ -37,6 +37,11 @@ public class LoginSuccess extends DefinedPacket { properties = readProperties( buf ); } + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 ) + { + // Whether the client should disconnect on its own if it receives invalid data from the server + buf.readBoolean(); + } } @Override @@ -54,6 +59,12 @@ public class LoginSuccess extends DefinedPacket { writeProperties( properties, buf ); } + if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 ) + { + // Whether the client should disconnect on its own if it receives invalid data from the server + // Vanilla sends true so we also send true + buf.writeBoolean( true ); + } } @Override