#1958: Negative compression thresholds disable compression like Vanilla

This commit is contained in:
md_5 2016-12-16 10:43:29 +11:00
parent 3ee7fdd90e
commit 4fa9961c15

View File

@ -614,7 +614,7 @@ public final class UserConnection implements ProxiedPlayer
public void setCompressionThreshold(int compressionThreshold) public void setCompressionThreshold(int compressionThreshold)
{ {
if ( ch.getHandle().isActive() && this.compressionThreshold == -1 ) if ( ch.getHandle().isActive() && this.compressionThreshold == -1 && compressionThreshold >= 0 )
{ {
this.compressionThreshold = compressionThreshold; this.compressionThreshold = compressionThreshold;
unsafe.sendPacket( new SetCompression( compressionThreshold ) ); unsafe.sendPacket( new SetCompression( compressionThreshold ) );