compression level change with config option (#9711)

This commit is contained in:
leguan
2023-09-14 13:11:19 +02:00
parent f4883a8c07
commit 9466e0d55a
2 changed files with 7 additions and 2 deletions

View File

@@ -308,7 +308,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void setupCompression(int compressionThreshold, boolean rejectsBadPackets) {
if (compressionThreshold >= 0) {
+ com.velocitypowered.natives.compression.VelocityCompressor compressor = com.velocitypowered.natives.util.Natives.compress.get().create(-1); // Paper
+ com.velocitypowered.natives.compression.VelocityCompressor compressor = com.velocitypowered.natives.util.Natives.compress.get().create(io.papermc.paper.configuration.GlobalConfiguration.get().misc.compressionLevel.or(-1)); // Paper
if (this.channel.pipeline().get("decompress") instanceof CompressionDecoder) {
((CompressionDecoder) this.channel.pipeline().get("decompress")).setThreshold(compressionThreshold, rejectsBadPackets);
} else {