Use real vanilla limits for LegacyChat (#1502)

Client -> server
< 1.11 has 100
>= 1.11 has 256

Server -> client has always 262144
This commit is contained in:
Outfluencer
2025-01-31 14:11:39 +01:00
committed by GitHub
parent 0e84b57e53
commit 91bdcebb1a

View File

@@ -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();