From e834af9cf10d6c13703cb9ff6f349e196cb3d2bd Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Thu, 9 Apr 2026 19:04:02 +0100 Subject: [PATCH] Increase max ratio Older versions of the game, and creative mode, send itemstacks to the server when dealing with itemstacks, annoying, the compression algo used is good at backreferencing, which means that compressed data can balloon pretty well. 64 should more than cover most cases of legit data, we could probably be more harsh here, but this is likely a fine balance between avoiding bombs and not erring out on legit data. --- .../proxy/protocol/netty/MinecraftCompressDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressDecoder.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressDecoder.java index 2528c0fd1..59cb00ea2 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressDecoder.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressDecoder.java @@ -44,7 +44,7 @@ public class MinecraftCompressDecoder extends MessageToMessageDecoder { Boolean.getBoolean("velocity.increased-compression-cap") ? HARD_MAXIMUM_UNCOMPRESSED_SIZE : SERVERBOUND_MAXIMUM_UNCOMPRESSED_SIZE; private static final boolean SKIP_COMPRESSION_VALIDATION = Boolean.getBoolean("velocity.skip-uncompressed-packet-size-validation"); - private static final double MAX_COMPRESSION_RATIO = Double.parseDouble(System.getProperty("velocity.max-compression-ratio", "10")); + private static final double MAX_COMPRESSION_RATIO = Double.parseDouble(System.getProperty("velocity.max-compression-ratio", "64")); private final ProtocolUtils.Direction direction; private int threshold;