diff --git a/patches/server/Paper-config-files.patch b/patches/server/Paper-config-files.patch index fc61cd0d03..3b7126b2c0 100644 --- a/patches/server/Paper-config-files.patch +++ b/patches/server/Paper-config-files.patch @@ -449,6 +449,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import co.aikar.timings.MinecraftTimings; +import io.papermc.paper.configuration.constraint.Constraint; +import io.papermc.paper.configuration.constraint.Constraints; ++import io.papermc.paper.configuration.type.IntOr; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; +import net.minecraft.network.protocol.Packet; @@ -725,6 +726,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public boolean useAlternativeLuckFormula = false; + public boolean useDimensionTypeForCustomSpawners = false; + public boolean strictAdvancementDimensionCheck = false; ++ public IntOr.Default compressionLevel = IntOr.Default.USE_DEFAULT; + } + + public BlockUpdates blockUpdates; @@ -1129,7 +1131,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private static ConfigurationOptions defaultGlobalOptions(ConfigurationOptions options) { + return options + .header(GLOBAL_HEADER) -+ .serializers(builder -> builder.register(new PacketClassSerializer())); ++ .serializers(builder -> builder ++ .register(new PacketClassSerializer()) ++ .register(IntOr.Default.SERIALIZER) ++ ); + } + + @Override diff --git a/patches/server/Use-Velocity-compression-and-cipher-natives.patch b/patches/server/Use-Velocity-compression-and-cipher-natives.patch index 833ee71203..0dc605c80f 100644 --- a/patches/server/Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/Use-Velocity-compression-and-cipher-natives.patch @@ -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 {