From 91bdcebb1aefd7eb21ef88356e4dc88a3f697cb3 Mon Sep 17 00:00:00 2001 From: Outfluencer Date: Fri, 31 Jan 2025 14:11:39 +0100 Subject: [PATCH] Use real vanilla limits for LegacyChat (#1502) Client -> server < 1.11 has 100 >= 1.11 has 256 Server -> client has always 262144 --- .../proxy/protocol/packet/chat/legacy/LegacyChatPacket.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/legacy/LegacyChatPacket.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/legacy/LegacyChatPacket.java index ccefdd13..80b239d5 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/legacy/LegacyChatPacket.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/legacy/LegacyChatPacket.java @@ -91,7 +91,8 @@ public class LegacyChatPacket implements MinecraftPacket { @Override public void decode(ByteBuf buf, ProtocolUtils.Direction direction, ProtocolVersion version) { - message = ProtocolUtils.readString(buf, 256); + message = ProtocolUtils.readString(buf, direction == ProtocolUtils.Direction.CLIENTBOUND + ? 262144 : version.noLessThan(ProtocolVersion.MINECRAFT_1_11) ? 256 : 100); if (direction == ProtocolUtils.Direction.CLIENTBOUND && version.noLessThan(ProtocolVersion.MINECRAFT_1_8)) { type = buf.readByte();