2019-12-13 16:22:16 +00:00
|
|
|
From 79638ebade63eda20f529d12b40bca871cbe13dc Mon Sep 17 00:00:00 2001
|
2019-06-22 20:17:40 +00:00
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
Date: Sat, 22 Jun 2019 04:20:47 -0700
|
|
|
|
Subject: [PATCH] Use ChunkStatus cache when saving protochunks
|
|
|
|
|
|
|
|
The cache should contain the chunk status when saving. If not it
|
|
|
|
will load it.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
2019-12-12 20:58:07 +00:00
|
|
|
index 8e2208422..cbab813d9 100644
|
2019-06-22 20:17:40 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
2019-12-12 16:20:43 +00:00
|
|
|
@@ -775,8 +775,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
2019-06-22 20:17:40 +00:00
|
|
|
NBTTagCompound nbttagcompound;
|
|
|
|
|
|
|
|
if (chunkstatus.getType() != ChunkStatus.Type.LEVELCHUNK) {
|
|
|
|
- nbttagcompound = this.readChunkData(chunkcoordintpair);
|
|
|
|
- if (nbttagcompound != null && ChunkRegionLoader.a(nbttagcompound) == ChunkStatus.Type.LEVELCHUNK) {
|
|
|
|
+ // Paper start - Optimize save by using status cache
|
2019-07-08 06:52:08 +00:00
|
|
|
+ ChunkStatus statusOnDisk = this.getChunkStatusOnDisk(chunkcoordintpair);
|
2019-06-22 20:17:40 +00:00
|
|
|
+ if (statusOnDisk != null && statusOnDisk.getType() == ChunkStatus.Type.LEVELCHUNK) {
|
|
|
|
+ // Paper end
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2019-12-12 16:20:43 +00:00
|
|
|
2.24.1
|
2019-06-22 20:17:40 +00:00
|
|
|
|