diff --git a/src/main/java/io/minimum/minecraft/velocity/protocol/netty/MinecraftCompressEncoder.java b/src/main/java/io/minimum/minecraft/velocity/protocol/netty/MinecraftCompressEncoder.java index 9696bc0be..3dfbed37f 100644 --- a/src/main/java/io/minimum/minecraft/velocity/protocol/netty/MinecraftCompressEncoder.java +++ b/src/main/java/io/minimum/minecraft/velocity/protocol/netty/MinecraftCompressEncoder.java @@ -26,8 +26,9 @@ public class MinecraftCompressEncoder extends MessageToByteEncoder { ByteBuf compressedBuffer = ctx.alloc().buffer(); try { + int uncompressed = msg.readableBytes(); compressor.deflate(msg, compressedBuffer); - ProtocolUtils.writeVarInt(out, msg.readableBytes()); + ProtocolUtils.writeVarInt(out, uncompressed); out.writeBytes(compressedBuffer); } finally { compressedBuffer.release();