Add option to flush region files on save (#9149)
This commit is contained in:
parent
efd47e3a68
commit
1edfefdef8
3 changed files with 14 additions and 6 deletions
|
@ -5486,10 +5486,10 @@ index 0000000000000000000000000000000000000000..fb42d776f15f735fb59e972e00e2b512
|
|||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e4dcadc24b3d73178ee1a4b64b8c6343e5285e59
|
||||
index 0000000000000000000000000000000000000000..748cc48c6c42c694d1c9b685e96fbe6d8337d3f3
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkHolderManager.java
|
||||
@@ -0,0 +1,1204 @@
|
||||
@@ -0,0 +1,1211 @@
|
||||
+package io.papermc.paper.chunk.system.scheduling;
|
||||
+
|
||||
+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
|
||||
|
@ -5749,6 +5749,13 @@ index 0000000000000000000000000000000000000000..e4dcadc24b3d73178ee1a4b64b8c6343
|
|||
+ }
|
||||
+ if (flush) {
|
||||
+ RegionFileIOThread.flush();
|
||||
+ if (this.world.paperConfig().chunks.flushRegionsOnSave) {
|
||||
+ try {
|
||||
+ this.world.chunkSource.chunkMap.regionFileCache.flush();
|
||||
+ } catch (IOException ex) {
|
||||
+ LOGGER.error("Exception when flushing regions in world {}", this.world.getWorld().getName(), ex);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if (logProgress) {
|
||||
+ LOGGER.info("Saved " + savedChunk + " block chunks, " + savedEntity + " entity chunks, " + savedPoi + " poi chunks in world '" + this.world.getWorld().getName() + "' in " + format.format(1.0E-9 * (System.nanoTime() - start)) + "s");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue