diff --git a/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java b/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java index d128bc89b..5e3959246 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java @@ -179,6 +179,9 @@ public class VelocityConfiguration { ", ipForwardingMode=" + ipForwardingMode + ", servers=" + servers + ", attemptConnectionOrder=" + attemptConnectionOrder + + ", compressionThreshold=" + compressionThreshold + + ", compressionLevel=" + compressionLevel + + ", motdAsComponent=" + motdAsComponent + '}'; } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java index b4437e535..cb182d8af 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java @@ -126,8 +126,10 @@ public class LoginSessionHandler implements MinecraftSessionHandler { } int threshold = VelocityServer.getServer().getConfiguration().getCompressionThreshold(); - inbound.write(new SetCompression(threshold)); - inbound.setCompressionThreshold(threshold); + if (threshold >= 0) { + inbound.write(new SetCompression(threshold)); + inbound.setCompressionThreshold(threshold); + } ServerLoginSuccess success = new ServerLoginSuccess(); success.setUsername(profile.getName());