mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-27 02:49:19 +00:00
Updated Upstream (Gale/Purpur/Leaves/Dependencies)
This commit is contained in:
@@ -17,38 +17,23 @@ This format saves about 50% of disk space.
|
||||
Documentation: https://github.com/xymb-endcrystalme/LinearRegionFileFormatTools
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 2adcf3c29257580b814e66b451ca71e772a6f49f..4dccb446c22055c2b4c9986094898607566fa204 100644
|
||||
index f9b4cd6f7032908ff32cfa68e736c01eaec24ce1..bc77b529a6345ccc79c344cfe807ff93396307d6 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -22,6 +22,8 @@ dependencies {
|
||||
}
|
||||
// Gale end - project setup
|
||||
// Paper start
|
||||
+ implementation("com.github.luben:zstd-jni:1.5.5-11")
|
||||
+ implementation("org.lz4:lz4-java:1.8.0")
|
||||
implementation("org.jline:jline-terminal-jansi:3.25.0") // Leaf - Bump Dependencies
|
||||
+ implementation("com.github.luben:zstd-jni:1.5.5-11") // LinearPurpur
|
||||
+ implementation("org.lz4:lz4-java:1.8.0") // LinearPurpur
|
||||
implementation("org.jline:jline-terminal-jansi:3.25.1") // Leaf - Bump Dependencies
|
||||
implementation("com.github.Dreeam-qwq:TerminalConsoleAppender:360a0759") // Leaf - Use own TerminalConsoleAppender fork to fix some issues under latest version of jline/log4j
|
||||
implementation("net.kyori:adventure-text-serializer-ansi:4.15.0") // Keep in sync with adventureVersion from Paper-API build file // Leaf - Bump Dependencies
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java
|
||||
index f2c27e0ac65be4b75c1d86ef6fd45fdb538d96ac..bcd35b189bf5ec44733161df952ef6957f7fbe79 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java
|
||||
@@ -314,8 +314,8 @@ public final class PaperFileIOThread extends QueueExecutorThread {
|
||||
public abstract void writeData(final int x, final int z, final CompoundTag compound) throws IOException;
|
||||
public abstract CompoundTag readData(final int x, final int z) throws IOException;
|
||||
|
||||
- public abstract <T> T computeForRegionFile(final int chunkX, final int chunkZ, final Function<RegionFile, T> function);
|
||||
- public abstract <T> T computeForRegionFileIfLoaded(final int chunkX, final int chunkZ, final Function<RegionFile, T> function);
|
||||
+ public abstract <T> T computeForRegionFile(final int chunkX, final int chunkZ, final Function<org.purpurmc.purpur.region.AbstractRegionFile, T> function); // LinearPurpur
|
||||
+ public abstract <T> T computeForRegionFileIfLoaded(final int chunkX, final int chunkZ, final Function<org.purpurmc.purpur.region.AbstractRegionFile, T> function); // LinearPurpur
|
||||
|
||||
public static final class InProgressWrite {
|
||||
public long writeCounter;
|
||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java b/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java
|
||||
index 8a11e10b01fa012b2f98b1c193c53251e848f909..17b6199a8b7184cf5b4b59d88ed8bdcae88bf0bf 100644
|
||||
index 2934f0cf0ef09c84739312b00186c2ef0019a165..e67543ef424d448096379bef118b8cb24b938964 100644
|
||||
--- a/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java
|
||||
+++ b/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java
|
||||
@@ -811,7 +811,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
@@ -816,7 +816,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
final ChunkDataController taskController) {
|
||||
final ChunkPos chunkPos = new ChunkPos(chunkX, chunkZ);
|
||||
if (intendingToBlock) {
|
||||
@@ -57,7 +42,7 @@ index 8a11e10b01fa012b2f98b1c193c53251e848f909..17b6199a8b7184cf5b4b59d88ed8bdca
|
||||
if (file == null) { // null if no regionfile exists
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
@@ -824,7 +824,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
@@ -829,7 +829,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
return Boolean.FALSE;
|
||||
} // else: it either exists or is not known, fall back to checking the loaded region file
|
||||
|
||||
@@ -66,7 +51,7 @@ index 8a11e10b01fa012b2f98b1c193c53251e848f909..17b6199a8b7184cf5b4b59d88ed8bdca
|
||||
if (file == null) { // null if not loaded
|
||||
// not sure at this point, let the I/O thread figure it out
|
||||
return Boolean.TRUE;
|
||||
@@ -1126,9 +1126,9 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
@@ -1131,9 +1131,9 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
return this.getCache().doesRegionFileNotExistNoIO(new ChunkPos(chunkX, chunkZ));
|
||||
}
|
||||
|
||||
@@ -78,7 +63,7 @@ index 8a11e10b01fa012b2f98b1c193c53251e848f909..17b6199a8b7184cf5b4b59d88ed8bdca
|
||||
synchronized (cache) {
|
||||
try {
|
||||
regionFile = cache.getRegionFile(new ChunkPos(chunkX, chunkZ), existingOnly, true);
|
||||
@@ -1141,19 +1141,19 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
@@ -1146,19 +1146,19 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
return function.apply(regionFile);
|
||||
} finally {
|
||||
if (regionFile != null) {
|
||||
@@ -102,7 +87,7 @@ index 8a11e10b01fa012b2f98b1c193c53251e848f909..17b6199a8b7184cf5b4b59d88ed8bdca
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1161,7 +1161,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
@@ -1166,7 +1166,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
return function.apply(regionFile);
|
||||
} finally {
|
||||
if (regionFile != null) {
|
||||
@@ -112,7 +97,7 @@ index 8a11e10b01fa012b2f98b1c193c53251e848f909..17b6199a8b7184cf5b4b59d88ed8bdca
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
|
||||
index c13df3a375f416273c6a26f5f77624c1f34a918c..e2c780e7d914e2cfd322fe07951aa54ab7ac8be4 100644
|
||||
index 8dffb330b474b830d2f816ecf8be2e8d2e4556cd..bed46642b59d38e58e6aa663a47cbfc92a40963b 100644
|
||||
--- a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
|
||||
+++ b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
|
||||
@@ -85,8 +85,15 @@ public class ThreadedWorldUpgrader {
|
||||
@@ -133,10 +118,10 @@ index c13df3a375f416273c6a26f5f77624c1f34a918c..e2c780e7d914e2cfd322fe07951aa54a
|
||||
long expectedChunks = (long)regionFiles.length * (32L * 32L);
|
||||
// Gale start - instantly continue on world upgrade finish
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index cd259a016a3f3189aab59ab1950e991fe6c31cd2..252ca6e63e50f4f19445c6abec24619ab7f845fd 100644
|
||||
index 5b7f99a534dc7a02fcc6d6b01a80d5c62d8af527..0f3e73414ec946915c0a048c3174d516c1c93d38 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -868,7 +868,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -866,7 +866,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper start - rewrite chunk system
|
||||
worldserver.save((ProgressListener) null, flush, worldserver.noSave && !force, close);
|
||||
if (flush) {
|
||||
@@ -145,7 +130,7 @@ index cd259a016a3f3189aab59ab1950e991fe6c31cd2..252ca6e63e50f4f19445c6abec24619a
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
}
|
||||
@@ -892,7 +892,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -890,7 +890,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
//MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", worldserver2.getChunkSource().chunkMap.getStorageName()); // Paper - move up
|
||||
}
|
||||
|
||||
@@ -155,7 +140,7 @@ index cd259a016a3f3189aab59ab1950e991fe6c31cd2..252ca6e63e50f4f19445c6abec24619a
|
||||
|
||||
return flag3;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 62ac94fff8542eedd3fea5fbaef5c4f617fdac01..c175681d1e57d0ea922bec1f1c10cfb14fcbb25e 100644
|
||||
index da9c5d362a0bde281c95e9ebc413c51d66aaaa0f..5dd66c3434205c03eecb842ee0211d9e19ff110f 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -246,7 +246,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -176,9 +161,9 @@ index 62ac94fff8542eedd3fea5fbaef5c4f617fdac01..c175681d1e57d0ea922bec1f1c10cfb1
|
||||
this.setServerViewDistance(viewDistance);
|
||||
// Paper start
|
||||
this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new);
|
||||
@@ -875,13 +875,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -861,13 +861,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
// Paper start - chunk status cache "api"
|
||||
public ChunkStatus getChunkStatusOnDiskIfCached(ChunkPos chunkPos) {
|
||||
- net.minecraft.world.level.chunk.storage.RegionFile regionFile = regionFileCache.getRegionFileIfLoaded(chunkPos);
|
||||
+ org.purpurmc.purpur.region.AbstractRegionFile regionFile = regionFileCache.getRegionFileIfLoaded(chunkPos); // LinearPurpur
|
||||
@@ -192,7 +177,7 @@ index 62ac94fff8542eedd3fea5fbaef5c4f617fdac01..c175681d1e57d0ea922bec1f1c10cfb1
|
||||
|
||||
if (regionFile == null || !regionFileCache.chunkExists(chunkPos)) {
|
||||
return null;
|
||||
@@ -899,7 +899,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -885,7 +885,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
public void updateChunkStatusOnDisk(ChunkPos chunkPos, @Nullable CompoundTag compound) throws IOException {
|
||||
@@ -202,10 +187,10 @@ index 62ac94fff8542eedd3fea5fbaef5c4f617fdac01..c175681d1e57d0ea922bec1f1c10cfb1
|
||||
regionFile.setStatus(chunkPos.x, chunkPos.z, ChunkSerializer.getStatus(compound));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index dbd18a3b72cb116f636049e137464cc4922e830c..3019b98d6004c3e83c15ff9c388bd3b802003dd7 100644
|
||||
index a3b9068efc38b3eb05e884bcc3fb13532e49308d..af8f03baf951fd539997092ae6be65673c217470 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -424,8 +424,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -419,8 +419,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
private static final class EntityRegionFileStorage extends net.minecraft.world.level.chunk.storage.RegionFileStorage {
|
||||
|
||||
@@ -216,7 +201,7 @@ index dbd18a3b72cb116f636049e137464cc4922e830c..3019b98d6004c3e83c15ff9c388bd3b8
|
||||
}
|
||||
|
||||
protected void write(ChunkPos pos, net.minecraft.nbt.CompoundTag nbt) throws IOException {
|
||||
@@ -753,7 +753,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -748,7 +748,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// CraftBukkit end
|
||||
boolean flag2 = minecraftserver.forceSynchronousWrites();
|
||||
DataFixer datafixer = minecraftserver.getFixerUpper();
|
||||
@@ -226,7 +211,7 @@ index dbd18a3b72cb116f636049e137464cc4922e830c..3019b98d6004c3e83c15ff9c388bd3b8
|
||||
// this.entityManager = new PersistentEntitySectionManager<>(Entity.class, new ServerLevel.EntityCallbacks(), entitypersistentstorage, this.entitySliceManager); // Paper // Paper - rewrite chunk system
|
||||
StructureTemplateManager structuretemplatemanager = minecraftserver.getStructureManager();
|
||||
diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||
index f2a7cb6ebed7a4b4019a09af2a025f624f6fe9c9..61c3730a1448e89c59983a1e92507592f61de964 100644
|
||||
index 77dd632a266f4abed30b87b7909d77857c01e316..4938d86f62071f578822684f576b838296d4070f 100644
|
||||
--- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||
+++ b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||
@@ -61,7 +61,7 @@ public class WorldUpgrader {
|
||||
@@ -253,7 +238,7 @@ index f2a7cb6ebed7a4b4019a09af2a025f624f6fe9c9..61c3730a1448e89c59983a1e92507592
|
||||
}
|
||||
|
||||
ImmutableMap<ResourceKey<Level>, ChunkStorage> immutablemap1 = builder1.build();
|
||||
@@ -235,7 +241,7 @@ public class WorldUpgrader {
|
||||
@@ -241,7 +247,7 @@ public class WorldUpgrader {
|
||||
File file = this.levelStorage.getDimensionPath(world).toFile();
|
||||
File file1 = new File(file, "region");
|
||||
File[] afile = file1.listFiles((file2, s) -> {
|
||||
@@ -262,7 +247,7 @@ index f2a7cb6ebed7a4b4019a09af2a025f624f6fe9c9..61c3730a1448e89c59983a1e92507592
|
||||
});
|
||||
|
||||
if (afile == null) {
|
||||
@@ -254,7 +260,11 @@ public class WorldUpgrader {
|
||||
@@ -260,7 +266,11 @@ public class WorldUpgrader {
|
||||
int l = Integer.parseInt(matcher.group(2)) << 5;
|
||||
|
||||
try {
|
||||
@@ -291,25 +276,23 @@ index 12a7aaeaa8b4b788b620b1985591c3b93253ccd5..af639cc29999a49f4f2d494dc82f9957
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
|
||||
index 4a84ada69c6abc8f2743579d4451e639836274b4..31cd961bc296f84f5482318c1fb7fcef3e3c1445 100644
|
||||
index d16d7c2fed89fb1347df7ddd95856e7f08c22e8a..625a49f42bdd36772a8f4a992396f76822026911 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
|
||||
@@ -37,11 +37,11 @@ public class ChunkStorage implements AutoCloseable {
|
||||
public final RegionFileStorage regionFileCache;
|
||||
// Paper end - async chunk loading
|
||||
@@ -36,9 +36,9 @@ public class ChunkStorage implements AutoCloseable {
|
||||
@Nullable
|
||||
private volatile LegacyStructureDataHandler legacyStructureHandler;
|
||||
|
||||
- public ChunkStorage(Path directory, DataFixer dataFixer, boolean dsync) {
|
||||
+ public ChunkStorage(org.purpurmc.purpur.region.RegionFileFormat format, int linearCompression, boolean linearCrashOnBrokenSymlink, Path directory, DataFixer dataFixer, boolean dsync) { // LinearPurpur
|
||||
this.fixerUpper = dataFixer;
|
||||
// Paper start - async chunk io
|
||||
// remove IO worker
|
||||
- this.regionFileCache = new RegionFileStorage(directory, dsync, true); // Paper - nuke IOWorker // Paper - Attempt to recalculate regionfile header if it is corrupt
|
||||
+ this.regionFileCache = new RegionFileStorage(format, linearCompression, linearCrashOnBrokenSymlink, directory, dsync, true); // Paper - nuke IOWorker // Paper - Attempt to recalculate regionfile header if it is corrupt // LinearPurpur
|
||||
// Paper end - async chunk io
|
||||
- this.regionFileCache = new RegionFileStorage(directory, dsync, true); // Paper - rewrite chunk system; async chunk IO & Attempt to recalculate regionfile header if it is corrupt
|
||||
+ this.regionFileCache = new RegionFileStorage(format, linearCompression, linearCrashOnBrokenSymlink, directory, dsync, true); // Paper - rewrite chunk system; async chunk IO & Attempt to recalculate regionfile header if it is corrupt // LinearPurpur
|
||||
}
|
||||
|
||||
public boolean isOldChunkAround(ChunkPos chunkPos, int checkRadius) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
index ad0859ccc7603ebe3b51e16b275d952bd2508299..0d21e8fc3de43e9c02157114778be3a4ee3e708a 100644
|
||||
index 21070516fc936109f537494e38e240982bebf66a..9f8ce97791dda51a23937f6522ad877d75df7044 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.nbt.NbtIo; // Paper
|
||||
@@ -347,7 +330,7 @@ index ad0859ccc7603ebe3b51e16b275d952bd2508299..0d21e8fc3de43e9c02157114778be3a4
|
||||
if (!this.canRecalcHeader) {
|
||||
return false;
|
||||
}
|
||||
@@ -954,10 +964,10 @@ public class RegionFile implements AutoCloseable {
|
||||
@@ -955,10 +965,10 @@ public class RegionFile implements AutoCloseable {
|
||||
private static int getChunkIndex(int x, int z) {
|
||||
return (x & 31) + (z & 31) * 32;
|
||||
}
|
||||
@@ -360,7 +343,7 @@ index ad0859ccc7603ebe3b51e16b275d952bd2508299..0d21e8fc3de43e9c02157114778be3a4
|
||||
final int offset = getChunkIndex(x, z);
|
||||
boolean previous = this.oversized[offset] == 1;
|
||||
this.oversized[offset] = (byte) (oversized ? 1 : 0);
|
||||
@@ -996,7 +1006,7 @@ public class RegionFile implements AutoCloseable {
|
||||
@@ -997,7 +1007,7 @@ public class RegionFile implements AutoCloseable {
|
||||
return this.regionFile.getParent().resolve(this.regionFile.getFileName().toString().replaceAll("\\.mca$", "") + "_oversized_" + x + "_" + z + ".nbt");
|
||||
}
|
||||
|
||||
@@ -370,7 +353,7 @@ index ad0859ccc7603ebe3b51e16b275d952bd2508299..0d21e8fc3de43e9c02157114778be3a4
|
||||
try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new InflaterInputStream(Files.newInputStream(file))))) {
|
||||
return NbtIo.read((java.io.DataInput) out);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb36a582d2a 100644
|
||||
index fe312b1aef579cb4bf81bdd967cf72ff880d7505..8ee307a453e79e59444f5c5b8b45ffc7755237c7 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -19,11 +19,17 @@ import net.minecraft.world.level.ChunkPos;
|
||||
@@ -474,7 +457,7 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
@@ -123,28 +148,45 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
}
|
||||
// Paper end - cache regionfile does not exist state
|
||||
if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - configurable
|
||||
if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - Sanitise RegionFileCache and make configurable
|
||||
- ((RegionFile) this.regionCache.removeLast()).close();
|
||||
+ this.regionCache.removeLast().close(); // LinearPurpur
|
||||
}
|
||||
@@ -524,16 +507,16 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
}
|
||||
// Paper end
|
||||
return regionfile1;
|
||||
@@ -172,7 +214,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -156,7 +198,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed.");
|
||||
}
|
||||
|
||||
|
||||
- private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
||||
+ private static CompoundTag readOversizedChunk(org.purpurmc.purpur.region.AbstractRegionFile regionfile, ChunkPos chunkCoordinate) throws IOException { // LinearPurpur
|
||||
synchronized (regionfile) {
|
||||
try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) {
|
||||
CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
|
||||
@@ -219,14 +261,14 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -191,14 +233,14 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@Nullable
|
||||
public CompoundTag read(ChunkPos pos) throws IOException {
|
||||
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
||||
@@ -550,7 +533,7 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
// We add the regionfile parameter to avoid the potential deadlock (on fileLock) if we went back to obtain a regionfile
|
||||
// if we decide to re-read
|
||||
// Paper end
|
||||
@@ -236,7 +278,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -208,7 +250,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
|
||||
// Paper start
|
||||
if (regionfile.isOversized(pos.x, pos.z)) {
|
||||
@@ -559,7 +542,7 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
return readOversizedChunk(regionfile, pos);
|
||||
}
|
||||
// Paper end
|
||||
@@ -250,12 +292,12 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -222,12 +264,12 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
if (this.isChunkData) {
|
||||
ChunkPos chunkPos = ChunkSerializer.getChunkCoordinate(nbttagcompound);
|
||||
if (!chunkPos.equals(pos)) {
|
||||
@@ -575,7 +558,7 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -289,13 +331,13 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -261,13 +303,13 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
|
||||
return nbttagcompound;
|
||||
} finally { // Paper start
|
||||
@@ -591,25 +574,25 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
if (regionfile == null) {
|
||||
return;
|
||||
}
|
||||
@@ -325,7 +367,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
}
|
||||
@@ -298,7 +340,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
|
||||
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
|
||||
- RegionFile regionfile = this.getRegionFile(pos, nbt == null, true); // CraftBukkit // Paper // Paper start - rewrite chunk system
|
||||
// Paper start - rewrite chunk system
|
||||
- RegionFile regionfile = this.getRegionFile(pos, nbt == null, true); // CraftBukkit
|
||||
+ org.purpurmc.purpur.region.AbstractRegionFile regionfile = this.getRegionFile(pos, nbt == null, true); // CraftBukkit // Paper // Paper start - rewrite chunk system // LinearPurpur
|
||||
if (nbt == null && regionfile == null) {
|
||||
return;
|
||||
}
|
||||
@@ -375,7 +417,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
}
|
||||
// Paper end
|
||||
} finally { // Paper start
|
||||
@@ -353,7 +395,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
// Paper end - Chunk save reattempt
|
||||
// Paper start - rewrite chunk system
|
||||
} finally {
|
||||
- regionfile.fileLock.unlock();
|
||||
+ regionfile.getFileLock().unlock(); // LinearPurpur
|
||||
} // Paper end
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
}
|
||||
|
||||
@@ -384,7 +426,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -363,7 +405,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
ObjectIterator objectiterator = this.regionCache.values().iterator();
|
||||
|
||||
while (objectiterator.hasNext()) {
|
||||
@@ -618,7 +601,7 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
|
||||
try {
|
||||
regionfile.close();
|
||||
@@ -400,7 +442,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -379,7 +421,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
ObjectIterator objectiterator = this.regionCache.values().iterator();
|
||||
|
||||
while (objectiterator.hasNext()) {
|
||||
@@ -643,13 +626,13 @@ index 4aac1979cf57300825a999c876fcf24d3170e68e..79a389b9a139f6838adf32d3b5d4d7ec
|
||||
this.factory = factory;
|
||||
this.fixerUpper = dataFixer;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 4b222fc6a4824caffef4aad78092bd02a8892026..db36f3b98a3955ec867972f546211db8975734ec 100644
|
||||
index 9fc292c4767b6275b17d0657b4289327ebaeaefe..325e9580ac4409111488e2728b7ae5d0c5390a6c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -567,7 +567,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
world.getChunk(x, z); // make sure we're at ticket level 32 or lower
|
||||
return true;
|
||||
}
|
||||
|
||||
- net.minecraft.world.level.chunk.storage.RegionFile file;
|
||||
+ org.purpurmc.purpur.region.AbstractRegionFile file; // LinearPurpur
|
||||
try {
|
||||
@@ -680,7 +663,7 @@ index b12437a7e292fbf9aefc7a41b5bc1695733a11c5..c3f095236093c436d37c4730f5537d4f
|
||||
private static void disableGiveCommandDrops() {
|
||||
disableGiveCommandDrops = getBoolean("settings.disable-give-dropping", disableGiveCommandDrops);
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 0a29f28cf666896f0715d40bb121017e4675b4e7..2b4408d398962fa4feab9eb248540c6d11037a94 100644
|
||||
index 18a4b27a9159c211a0faf204e69e895f107b0163..b32fb80be08146d28d437d5db320c56ba05aebc7 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -27,6 +27,7 @@ import java.util.Map;
|
||||
|
||||
Reference in New Issue
Block a user