From b79d2d4a946b112c249ab76d1a38f6805eb5d3a9 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Fri, 19 Jun 2020 05:22:19 -0400 Subject: [PATCH] Fix tab complete using proper vanilla limit. --- .../proxy/protocol/packet/TabCompleteRequest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TabCompleteRequest.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TabCompleteRequest.java index 5db35433c..30bf616a0 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TabCompleteRequest.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TabCompleteRequest.java @@ -14,6 +14,8 @@ import org.checkerframework.checker.nullness.qual.Nullable; public class TabCompleteRequest implements MinecraftPacket { + private static final int VANILLA_MAX_TAB_COMPLETE_LEN = 2048; + private @Nullable String command; private int transactionId; private boolean assumeCommand; @@ -78,9 +80,9 @@ public class TabCompleteRequest implements MinecraftPacket { public void decode(ByteBuf buf, ProtocolUtils.Direction direction, ProtocolVersion version) { if (version.compareTo(MINECRAFT_1_13) >= 0) { this.transactionId = ProtocolUtils.readVarInt(buf); - this.command = ProtocolUtils.readString(buf, Chat.MAX_SERVERBOUND_MESSAGE_LENGTH); + this.command = ProtocolUtils.readString(buf, VANILLA_MAX_TAB_COMPLETE_LEN); } else { - this.command = ProtocolUtils.readString(buf, Chat.MAX_SERVERBOUND_MESSAGE_LENGTH); + this.command = ProtocolUtils.readString(buf, VANILLA_MAX_TAB_COMPLETE_LEN); if (version.compareTo(MINECRAFT_1_9) >= 0) { this.assumeCommand = buf.readBoolean(); }