13
0
geforkt von Mirrors/Paper

Fix chunks refusing to save (#2196)

We should only set hasBeenLoaded to false potentially after saving a chunk
other wise we will not save it. The method to do this is
PlayerChunk#l(), which we were potentially calling for chunks we were not saving.
Dieser Commit ist enthalten in:
Spottedleaf 2019-06-17 00:47:51 -07:00
Ursprung 90153c12f5
Commit a4a1cae173
3 geänderte Dateien mit 15 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -134,7 +134,7 @@ index 806d225aaa..97040528a0 100644
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 86831c3526..f4bdb2eda3 100644
index b71f98b0c5..e89738a08d 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -252,7 +252,7 @@ index 6f34d8aea0..d1323891fa 100644
printOversizedLog("ChunkTooLarge even after reduction. Trying in overzealous mode.", regionfile.file, chunkX, chunkZ);
// Eek, major fail. We have retry logic, so reduce threshholds and fall back
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0cdf723480..4026edabc2 100644
index e0d89cc533..53d4f46d45 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld implements World {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Show blockstate location if we failed to read it
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
index 7cb4c3e503..c3405950d8 100644
index 7cb4c3e503..a593882988 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
@@ -0,0 +0,0 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState

Datei anzeigen

@ -86,7 +86,7 @@ index 184f1b00f0..3dbe83c7ea 100644
this.methodProfiler.enter("snooper");
if (((DedicatedServer) this).getDedicatedServerProperties().snooperEnabled && !this.snooper.d() && this.ticks > 100) { // Spigot
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 7d48b580ac..86831c3526 100644
index 7d48b580ac..b71f98b0c5 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -103,28 +103,32 @@ index 7d48b580ac..86831c3526 100644
if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
- this.saveChunk(ichunkaccess);
- playerchunk.l();
- }
+ // paper start
+ boolean shouldSave = true;
+
- });
+ if (ichunkaccess instanceof Chunk) {
+ shouldSave = ((Chunk) ichunkaccess).lastSaved + world.paperConfig.autoSavePeriod <= world.getTime();
+ }
+
+ if (shouldSave && this.saveChunk(ichunkaccess)) ++savedThisTick;
playerchunk.l();
+ if (shouldSave && this.saveChunk(ichunkaccess)) {
+ ++savedThisTick;
+ playerchunk.l();
+ }
+
+ if (savedThisTick >= world.paperConfig.maxAutoSaveChunksPerTick) {
+ return;
+ }
}
-
- });
+ }
+ };
+ // paper end
}
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 92aad060ef..1c3815a9c4 100644
index 40b3d96edd..135ec94c6f 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World {