From b8131a09b29d86d0a7870128959a7a5df8225378 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 23 Oct 2022 09:09:18 -0700 Subject: [PATCH] Mark chunks as saved after saving them Prevents re-saving them again later. --- patches/server/0016-Rewrite-chunk-system.patch | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/patches/server/0016-Rewrite-chunk-system.patch b/patches/server/0016-Rewrite-chunk-system.patch index 1df2fdeeb1..74a4470d3a 100644 --- a/patches/server/0016-Rewrite-chunk-system.patch +++ b/patches/server/0016-Rewrite-chunk-system.patch @@ -9000,10 +9000,10 @@ index 0000000000000000000000000000000000000000..396d72c00e47cf1669ae20dc839c1c96 +} diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/NewChunkHolder.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/NewChunkHolder.java new file mode 100644 -index 0000000000000000000000000000000000000000..f20faaec3f1fe311b3ac989be5a9148e2e3c59ad +index 0000000000000000000000000000000000000000..4ce6df7082d4f7ed3651e3d57e379f95dd05715e --- /dev/null +++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/NewChunkHolder.java -@@ -0,0 +1,2072 @@ +@@ -0,0 +1,2075 @@ +package io.papermc.paper.chunk.system.scheduling; + +import ca.spottedleaf.concurrentutil.completable.Completable; @@ -10845,6 +10845,8 @@ index 0000000000000000000000000000000000000000..f20faaec3f1fe311b3ac989be5a9148e + + task.queue(); + ++ chunk.setUnsaved(false); ++ + return true; + } catch (final ThreadDeath death) { + throw death; @@ -10863,6 +10865,7 @@ index 0000000000000000000000000000000000000000..f20faaec3f1fe311b3ac989be5a9148e + } else { + RegionFileIOThread.scheduleSave(this.world, this.chunkX, this.chunkZ, save, RegionFileIOThread.RegionFileType.CHUNK_DATA); + } ++ chunk.setUnsaved(false); + } catch (final ThreadDeath death) { + throw death; + } catch (final Throwable thr) { @@ -12546,7 +12549,7 @@ index c59fca05484c30b28e883f5b5dde0362f294b517..0c6534e64ef023cf613f2c5407c7598c private ChunkSystem() { diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index b310d51b7fe3e8cef0a450674725969fe1ce78a4..c9e169a6dca4dd8fe6e27a23deb410664a5d4466 100644 +index 9db975e84609956b2206076e30f17a350adb77d6..f99929c0c5652dedf94b7e34ba599cedf5daf508 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -1,15 +1,28 @@