From 88a5abd26c4e53a3b32599359a36011a7e5e62ec Mon Sep 17 00:00:00 2001 From: James58899 Date: Wed, 3 Aug 2022 18:42:43 +0800 Subject: [PATCH] Fix command packet wrong mark as unsigned (#810) Dropping previousMessages will break the chat chain --- .../proxy/protocol/packet/chat/PlayerCommand.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/PlayerCommand.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/PlayerCommand.java index 38fe91865..ab0354624 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/PlayerCommand.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/PlayerCommand.java @@ -114,9 +114,6 @@ public class PlayerCommand implements MinecraftPacket { timestamp = Instant.ofEpochMilli(buf.readLong()); salt = buf.readLong(); - if (salt == 0L) { - unsigned = true; - } int mapSize = ProtocolUtils.readVarInt(buf); if (mapSize > MAX_NUM_ARGUMENTS) { @@ -152,6 +149,10 @@ public class PlayerCommand implements MinecraftPacket { } } + if (salt == 0L && previousMessages.length == 0) { + unsigned = true; + } + } @Override