From 9e83ee6f0cf3de7201fe75c671088392558bd6c3 Mon Sep 17 00:00:00 2001 From: Outfluencer <48880402+Outfluencer@users.noreply.github.com> Date: Tue, 12 Sep 2023 12:29:01 +0200 Subject: [PATCH] #3508: Use same compression threshold checks as Vanilla --- .../main/java/net/md_5/bungee/netty/ChannelWrapper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java index 6be2d942a..6e4529e97 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -124,11 +124,11 @@ public class ChannelWrapper public void setCompressionThreshold(int compressionThreshold) { - if ( ch.pipeline().get( PacketCompressor.class ) == null && compressionThreshold != -1 ) + if ( ch.pipeline().get( PacketCompressor.class ) == null && compressionThreshold >= 0 ) { addBefore( PipelineUtils.PACKET_ENCODER, "compress", new PacketCompressor() ); } - if ( compressionThreshold != -1 ) + if ( compressionThreshold >= 0 ) { ch.pipeline().get( PacketCompressor.class ).setThreshold( compressionThreshold ); } else @@ -136,11 +136,11 @@ public class ChannelWrapper ch.pipeline().remove( "compress" ); } - if ( ch.pipeline().get( PacketDecompressor.class ) == null && compressionThreshold != -1 ) + if ( ch.pipeline().get( PacketDecompressor.class ) == null && compressionThreshold >= 0 ) { addBefore( PipelineUtils.PACKET_DECODER, "decompress", new PacketDecompressor() ); } - if ( compressionThreshold == -1 ) + if ( compressionThreshold < 0 ) { ch.pipeline().remove( "decompress" ); }