From b64615e298ec18aa7377894c31937b72bd8f9b44 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 28 Jul 2024 21:07:49 +1000 Subject: [PATCH] #3715: Fix maximum length for command packets --- .../java/net/md_5/bungee/protocol/packet/ClientCommand.java | 2 +- .../net/md_5/bungee/protocol/packet/UnsignedClientCommand.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientCommand.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientCommand.java index 887ff29f..33c838f9 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientCommand.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ClientCommand.java @@ -32,7 +32,7 @@ public class ClientCommand extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { - command = readString( buf, 256 ); + command = readString( buf, ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 ) ? 32767 : 256 ); timestamp = buf.readLong(); salt = buf.readLong(); diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/UnsignedClientCommand.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/UnsignedClientCommand.java index 97a2bb70..5ee93eaf 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/UnsignedClientCommand.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/UnsignedClientCommand.java @@ -21,7 +21,7 @@ public class UnsignedClientCommand extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { - command = readString( buf, 256 ); + command = readString( buf, ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 ) ? 32767 : 256 ); } @Override