mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 06:30:46 +01:00
Add option to flush region files on save (#9149)
This commit is contained in:
parent
0dd7fe3b9c
commit
07674ea170
2 changed files with 8 additions and 0 deletions
|
@ -1880,6 +1880,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ map.put(EntityType.FIREBALL, -1);
|
||||
+ map.put(EntityType.SMALL_FIREBALL, -1);
|
||||
+ });
|
||||
+ public boolean flushRegionsOnSave = false;
|
||||
+ }
|
||||
+
|
||||
+ public FishingTimeRange fishingTimeRange;
|
||||
|
|
|
@ -5749,6 +5749,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ 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…
Reference in a new issue