Skip to content

Commit 04ee8ea

Browse files
authored
Remove Paper config unsupported-settings.compression-format (#13800)
1 parent c58cba3 commit 04ee8ea

File tree

6 files changed

+17
-42
lines changed

6 files changed

+17
-42
lines changed

paper-server/patches/features/0001-Moonrise-optimisation-patches.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33593,7 +33593,7 @@ index cc5d366f7b485f98901572b1aaf57d8b650d521f..7adb4be57bd9fdc9980b5b7e91e9d9ca
3359333593
private final Long2ObjectLinkedOpenHashMap<CompletableFuture<BitSet>> regionCacheForBlender = new Long2ObjectLinkedOpenHashMap<>();
3359433594
private static final int REGION_CACHE_SIZE = 1024;
3359533595
diff --git a/net/minecraft/world/level/chunk/storage/RegionFile.java b/net/minecraft/world/level/chunk/storage/RegionFile.java
33596-
index 728ec122b7af090427cc7511a168336d539835a1..5149635679ec03d881e63effbd79fc193d7e52c8 100644
33596+
index 9409cc5c8dbd12ce6bdf34843da70170ebce41bd..c9acbdce97cb605a45124bb9d3944070396adc03 100644
3359733597
--- a/net/minecraft/world/level/chunk/storage/RegionFile.java
3359833598
+++ b/net/minecraft/world/level/chunk/storage/RegionFile.java
3359933599
@@ -23,7 +23,7 @@ import net.minecraft.world.level.ChunkPos;
@@ -33625,7 +33625,7 @@ index 728ec122b7af090427cc7511a168336d539835a1..5149635679ec03d881e63effbd79fc19
3362533625
+ // Paper end - rewrite chunk system
3362633626
+
3362733627
public RegionFile(final RegionStorageInfo info, final Path path, final Path externalFileDir, final boolean sync) throws IOException {
33628-
this(info, path, externalFileDir, RegionFileVersion.getCompressionFormat(), sync); // Paper - Configurable region compression format
33628+
this(info, path, externalFileDir, RegionFileVersion.getSelected(), sync);
3362933629
}
3363033630
@@ -201,6 +216,15 @@ public class RegionFile implements AutoCloseable {
3363133631
}

paper-server/patches/features/0019-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ index a6f9435a8e2a6c8cc05bd3873cb6fc0ec98973b8..d44fd9eea0ccb09c894d6431ede8a4c2
5555
this.used.set(position, position + size);
5656
}
5757
diff --git a/net/minecraft/world/level/chunk/storage/RegionFile.java b/net/minecraft/world/level/chunk/storage/RegionFile.java
58-
index fc712f9dbc893a6dee8ccecc54d0af07659dee62..b4a59b855b45018853e8122a5829a48ebd220a5f 100644
58+
index 5e77906d77da82b23fbd6e8d16fbd0847c83f4da..e077797cefffcb9db627cab12c7d88245e5baa69 100644
5959
--- a/net/minecraft/world/level/chunk/storage/RegionFile.java
6060
+++ b/net/minecraft/world/level/chunk/storage/RegionFile.java
6161
@@ -47,6 +47,363 @@ public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patche
@@ -760,7 +760,7 @@ index 5fa64ff30b8252f139ca7f77c14352c384c8c0e5..eae4963b6d18c5f92871477b93f81c2c
760760

761761
return var4;
762762
diff --git a/net/minecraft/world/level/chunk/storage/RegionFileVersion.java b/net/minecraft/world/level/chunk/storage/RegionFileVersion.java
763-
index 97d3da90c270a06d85e70d261658f71d97ae4e3c..11b65c688144e7ef5b7cba603949843a11ccd084 100644
763+
index ea229f63f81c5638ded74c28e1e13d8948f2e5e0..d991fccfc3d2cc51611f802a6d40429024e21d9a 100644
764764
--- a/net/minecraft/world/level/chunk/storage/RegionFileVersion.java
765765
+++ b/net/minecraft/world/level/chunk/storage/RegionFileVersion.java
766766
@@ -21,7 +21,7 @@ import org.slf4j.Logger;
@@ -771,7 +771,7 @@ index 97d3da90c270a06d85e70d261658f71d97ae4e3c..11b65c688144e7ef5b7cba603949843a
771771
+ public static final Int2ObjectMap<RegionFileVersion> VERSIONS = new Int2ObjectOpenHashMap<>(); // Paper - private -> public
772772
private static final Object2ObjectMap<String, RegionFileVersion> VERSIONS_BY_NAME = new Object2ObjectOpenHashMap<>();
773773
public static final RegionFileVersion VERSION_GZIP = register(
774-
new RegionFileVersion(1, null, in -> new FastBufferedInputStream(new GZIPInputStream(in)), out -> new BufferedOutputStream(new GZIPOutputStream(out)))
774+
new RegionFileVersion(1, "gzip", in -> new FastBufferedInputStream(new GZIPInputStream(in)), out -> new BufferedOutputStream(new GZIPOutputStream(out))) // Paper - Enable for Configurable region compression format
775775
diff --git a/net/minecraft/world/level/chunk/storage/RegionStorageInfo.java b/net/minecraft/world/level/chunk/storage/RegionStorageInfo.java
776776
index 590bd1ca60956e5c5be58481f97401e55f9e1aeb..4e0c9fa1eecfa9f21285b7911e25830bbcbc8d86 100644
777777
--- a/net/minecraft/world/level/chunk/storage/RegionStorageInfo.java
@@ -791,7 +791,7 @@ index 590bd1ca60956e5c5be58481f97401e55f9e1aeb..4e0c9fa1eecfa9f21285b7911e25830b
791791
return new RegionStorageInfo(this.level, this.dimension, this.type + suffix);
792792
}
793793
diff --git a/net/minecraft/world/level/chunk/storage/SerializableChunkData.java b/net/minecraft/world/level/chunk/storage/SerializableChunkData.java
794-
index 22a83f312d357176a5489e5b6b71c3ef3e737df7..74158a5d7ea8058c99ab215265987746aa043fc7 100644
794+
index 1e0afa9590de7fe492cf29aded96be3db498c51e..df0bb06176ad5cce3ed8785d22d68b2dcbf5a8ca 100644
795795
--- a/net/minecraft/world/level/chunk/storage/SerializableChunkData.java
796796
+++ b/net/minecraft/world/level/chunk/storage/SerializableChunkData.java
797797
@@ -120,6 +120,18 @@ public record SerializableChunkData(
@@ -823,7 +823,7 @@ index 22a83f312d357176a5489e5b6b71c3ef3e737df7..74158a5d7ea8058c99ab215265987746
823823
tag.putString("Status", BuiltInRegistries.CHUNK_STATUS.getKey(this.chunkStatus).toString());
824824
tag.storeNullable("blending_data", BlendingData.Packed.CODEC, this.blendingData);
825825
diff --git a/net/minecraft/world/level/chunk/storage/SimpleRegionStorage.java b/net/minecraft/world/level/chunk/storage/SimpleRegionStorage.java
826-
index 884fa9545a93008fa92863c845aef8f18d88e25a..15da3686bb1b5fddd388a88a7b300aa221c83f58 100644
826+
index 6e55cb304fd9a5a01bbe7666dddb882e684cdcf1..6d954064f409ddd2cb7cfd0d0c428ac186f5ca4d 100644
827827
--- a/net/minecraft/world/level/chunk/storage/SimpleRegionStorage.java
828828
+++ b/net/minecraft/world/level/chunk/storage/SimpleRegionStorage.java
829829
@@ -34,6 +34,7 @@ public class SimpleRegionStorage implements ca.spottedleaf.moonrise.patches.chun

paper-server/patches/sources/net/minecraft/world/level/chunk/storage/RegionFile.java.patch

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
--- a/net/minecraft/world/level/chunk/storage/RegionFile.java
22
+++ b/net/minecraft/world/level/chunk/storage/RegionFile.java
3-
@@ -47,7 +_,7 @@
4-
protected final RegionBitmap usedSectors = new RegionBitmap();
5-
6-
public RegionFile(final RegionStorageInfo info, final Path path, final Path externalFileDir, final boolean sync) throws IOException {
7-
- this(info, path, externalFileDir, RegionFileVersion.getSelected(), sync);
8-
+ this(info, path, externalFileDir, RegionFileVersion.getCompressionFormat(), sync); // Paper - Configurable region compression format
9-
}
10-
11-
public RegionFile(final RegionStorageInfo info, final Path path, final Path externalFileDir, final RegionFileVersion version, final boolean sync) throws IOException {
123
@@ -83,6 +_,14 @@
134
if (offset != 0) {
145
int sectorNumber = getSectorNumber(offset);
Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
--- a/net/minecraft/world/level/chunk/storage/RegionFileVersion.java
22
+++ b/net/minecraft/world/level/chunk/storage/RegionFileVersion.java
3-
@@ -49,6 +_,16 @@
4-
private final RegionFileVersion.StreamWrapper<InputStream> inputWrapper;
5-
private final RegionFileVersion.StreamWrapper<OutputStream> outputWrapper;
6-
7-
+ // Paper start - Configurable region compression format
8-
+ public static RegionFileVersion getCompressionFormat() {
9-
+ return switch (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.compressionFormat) {
10-
+ case GZIP -> VERSION_GZIP;
11-
+ case ZLIB -> VERSION_DEFLATE;
12-
+ case LZ4 -> VERSION_LZ4;
13-
+ case NONE -> VERSION_NONE;
14-
+ };
15-
+ }
16-
+ // Paper end - Configurable region compression format
17-
private RegionFileVersion(
18-
final int id,
19-
final @Nullable String optionName,
3+
@@ -24,7 +_,7 @@
4+
private static final Int2ObjectMap<RegionFileVersion> VERSIONS = new Int2ObjectOpenHashMap<>();
5+
private static final Object2ObjectMap<String, RegionFileVersion> VERSIONS_BY_NAME = new Object2ObjectOpenHashMap<>();
6+
public static final RegionFileVersion VERSION_GZIP = register(
7+
- new RegionFileVersion(1, null, in -> new FastBufferedInputStream(new GZIPInputStream(in)), out -> new BufferedOutputStream(new GZIPOutputStream(out)))
8+
+ new RegionFileVersion(1, "gzip", in -> new FastBufferedInputStream(new GZIPInputStream(in)), out -> new BufferedOutputStream(new GZIPOutputStream(out))) // Paper - Enable for Configurable region compression format
9+
);
10+
public static final RegionFileVersion VERSION_DEFLATE = register(
11+
new RegionFileVersion(

paper-server/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,19 +183,10 @@ public class UnsupportedSettings extends ConfigurationPart {
183183
public boolean allowHeadlessPistons = false;
184184
@Comment("This setting controls if the vanilla damage tick should be skipped if damage was blocked via a shield.")
185185
public boolean skipVanillaDamageTickWhenShieldBlocked = false;
186-
@Comment("This setting controls what compression format is used for region files.")
187-
public CompressionFormat compressionFormat = CompressionFormat.ZLIB;
188186
@Comment("This setting controls if equipment should be updated when handling certain player actions.")
189187
public boolean updateEquipmentOnPlayerActions = true;
190188
@Comment("This setting controls what item data components don't need to be sanitized in oversized item obfuscation. Adding them re-enables exploits, but may be needed for certain resource packs. (Expected: minecraft:container, minecraft:charged_projectiles and minecraft:bundle_contents)")
191189
public OversizedItemComponentSanitizer.AssetOversizedItemComponentSanitizerConfiguration oversizedItemComponentSanitizer = new OversizedItemComponentSanitizer.AssetOversizedItemComponentSanitizerConfiguration(Set.of());
192-
193-
public enum CompressionFormat {
194-
GZIP,
195-
ZLIB,
196-
LZ4,
197-
NONE
198-
}
199190
}
200191

201192
public Commands commands;

paper-server/src/main/java/io/papermc/paper/configuration/RemovedConfigurations.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ interface RemovedConfigurations {
8686
path("misc", "fix-entity-position-desync"),
8787
path("chunk-system", "gen-parallelism"),
8888
path("logging"), // server is no longer obfuscated since 26.1
89+
path("unsupported-settings", "compression-format"),
8990
};
9091

9192
}

0 commit comments

Comments
 (0)