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.
This commit is contained in:
Shane Freeder
2026-04-09 19:04:02 +01:00
parent affc1d6e08
commit e834af9cf1

View File

@@ -44,7 +44,7 @@ public class MinecraftCompressDecoder extends MessageToMessageDecoder<ByteBuf> {
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;