From 013320fd9ec7e088a61634c28a3a39c5baab302d Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 16 Sep 2015 19:44:55 +1000 Subject: [PATCH] #1852: Fix packet compression when BungeeCord and the server are set to different compression levels. --- .../main/java/net/md_5/bungee/compress/PacketDecompressor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java index c1770016..4f33bc79 100644 --- a/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java +++ b/proxy/src/main/java/net/md_5/bungee/compress/PacketDecompressor.java @@ -35,7 +35,8 @@ public class PacketDecompressor extends ByteToMessageDecoder int size = DefinedPacket.readVarInt( in ); if ( size == 0 ) { - out.add( in.readBytes( in.readableBytes() ) ); + out.add( in.copy() ); + in.readerIndex( in.writerIndex() ); } else { ByteBuf decompressed = ctx.alloc().directBuffer();