From 2713831f77722eef4c34160515649ad3dc3cb9da Mon Sep 17 00:00:00 2001 From: Riley Park Date: Mon, 3 May 2021 19:38:39 -0700 Subject: [PATCH] Revert "Avoid calling writeVarInt in the (very) common uncompressed packet case" This reverts commit c041bea1b6ff82469313094c312f84a9c39e5ffa. --- .../proxy/protocol/netty/MinecraftCompressEncoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressEncoder.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressEncoder.java index 356c27231..f6cb495ca 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressEncoder.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressEncoder.java @@ -39,7 +39,7 @@ public class MinecraftCompressEncoder extends MessageToByteEncoder { int uncompressed = msg.readableBytes(); if (uncompressed < threshold) { // Under the threshold, there is nothing to do. - out.writeByte(0); + ProtocolUtils.writeVarInt(out, 0); out.writeBytes(msg); } else { ProtocolUtils.writeVarInt(out, uncompressed);