mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-10 09:31:57 +01:00
Configurable Region Compression Format
This commit is contained in:
parent
53fab9663b
commit
1abc111403
@ -5,6 +5,15 @@
|
|||||||
package net.minecraft.world.level.chunk.storage;
|
package net.minecraft.world.level.chunk.storage;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
|
@@ -49,7 +50,7 @@
|
||||||
|
protected final RegionBitmap usedSectors;
|
||||||
|
|
||||||
|
public RegionFile(RegionStorageInfo storageKey, Path directory, Path path, boolean dsync) throws IOException {
|
||||||
|
- this(storageKey, directory, path, RegionFileVersion.getSelected(), dsync);
|
||||||
|
+ this(storageKey, directory, path, RegionFileVersion.getCompressionFormat(), dsync); // Paper - Configurable region compression format
|
||||||
|
}
|
||||||
|
|
||||||
|
public RegionFile(RegionStorageInfo storageKey, Path path, Path directory, RegionFileVersion compressionFormat, boolean dsync) throws IOException {
|
||||||
@@ -63,8 +64,8 @@
|
@@ -63,8 +64,8 @@
|
||||||
} else {
|
} else {
|
||||||
this.externalFileDir = directory;
|
this.externalFileDir = directory;
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
--- a/net/minecraft/world/level/chunk/storage/RegionFileVersion.java
|
||||||
|
+++ b/net/minecraft/world/level/chunk/storage/RegionFileVersion.java
|
||||||
|
@@ -58,6 +58,15 @@
|
||||||
|
private final RegionFileVersion.StreamWrapper<InputStream> inputWrapper;
|
||||||
|
private final RegionFileVersion.StreamWrapper<OutputStream> outputWrapper;
|
||||||
|
|
||||||
|
+ // Paper start - Configurable region compression format
|
||||||
|
+ public static RegionFileVersion getCompressionFormat() {
|
||||||
|
+ return switch (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.compressionFormat) {
|
||||||
|
+ case GZIP -> VERSION_GZIP;
|
||||||
|
+ case ZLIB -> VERSION_DEFLATE;
|
||||||
|
+ case NONE -> VERSION_NONE;
|
||||||
|
+ };
|
||||||
|
+ }
|
||||||
|
+ // Paper end - Configurable region compression format
|
||||||
|
private RegionFileVersion(
|
||||||
|
int id,
|
||||||
|
@Nullable String name,
|
Loading…
Reference in New Issue
Block a user