Sometimes World.save() did not save the whole world. (#1538)

flag = true is a force save of the whole world (for example World.save()), this should ignore the current queue size.
This commit is contained in:
Brokkonaut 2018-10-05 17:23:20 +02:00
parent 2011e076be
commit 3ef552d105
2 changed files with 7 additions and 7 deletions

View File

@ -8,7 +8,7 @@ Adds a command line flag to enable stats on how chunk saves are processing.
Stats on current queue, how many was processed and how many were queued.
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 5197062293..e4d2a3a0b5 100644
index 09c81e9ab..a94719d58 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
@ -50,11 +50,11 @@ index 5197062293..e4d2a3a0b5 100644
+ );
+ }
+ }
if (queueSize > world.paperConfig.queueSizeAutoSaveThreshold){
if (!flag && queueSize > world.paperConfig.queueSizeAutoSaveThreshold){
return false;
}
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index e86d47a05e..ec328126cf 100644
index e86d47a05..ec328126c 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {

View File

@ -7,7 +7,7 @@ If the save queue already has 50 (configurable) of chunks pending,
then avoid processing auto save (which would add more)
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 0d456bcbac..40746c13ef 100644
index 0d456bcba..40746c13e 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -23,7 +23,7 @@ index 0d456bcbac..40746c13ef 100644
private void removeCorruptTEs() {
removeCorruptTEs = getBoolean("remove-corrupt-tile-entities", false);
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 69219b13a6..5197062293 100644
index 69219b13a..09c81e9ab 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
@ -33,7 +33,7 @@ index 69219b13a6..5197062293 100644
+ // Paper start
+ final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader;
+ final int queueSize = chunkLoader.getQueueSize();
+ if (queueSize > world.paperConfig.queueSizeAutoSaveThreshold){
+ if (!flag && queueSize > world.paperConfig.queueSizeAutoSaveThreshold){
+ return false;
+ }
+ // Paper end
@ -41,7 +41,7 @@ index 69219b13a6..5197062293 100644
Chunk chunk = (Chunk) objectiterator.next();
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 695044b1b1..e86d47a05e 100644
index 695044b1b..e86d47a05 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {