Revert "Avoid calling writeVarInt in the (very) common uncompressed packet case"

This reverts commit c041bea1b6.
This commit is contained in:
Riley Park
2021-05-03 19:38:39 -07:00
parent c041bea1b6
commit 2713831f77

View File

@@ -39,7 +39,7 @@ public class MinecraftCompressEncoder extends MessageToByteEncoder<ByteBuf> {
int uncompressed = msg.readableBytes(); int uncompressed = msg.readableBytes();
if (uncompressed < threshold) { if (uncompressed < threshold) {
// Under the threshold, there is nothing to do. // Under the threshold, there is nothing to do.
out.writeByte(0); ProtocolUtils.writeVarInt(out, 0);
out.writeBytes(msg); out.writeBytes(msg);
} else { } else {
ProtocolUtils.writeVarInt(out, uncompressed); ProtocolUtils.writeVarInt(out, uncompressed);