2019-06-25 04:14:30 +00:00
|
|
|
From 29d327049da018e9c3b4cb5b001582e8fdbd8259 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-06-25 01:47:58 +00:00
|
|
|
index 3f41072f72..f34d7d0dad 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-06-25 01:47:58 +00:00
|
|
|
@@ -718,8 +718,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
|
|
|
|
+ ChunkStatus statusOnDisk = this.getRegionFile(ichunkaccess.getPos(), false).getStatus(ichunkaccess.getPos().x, ichunkaccess.getPos().z, this);
|
|
|
|
+ if (statusOnDisk != null && statusOnDisk.getType() == ChunkStatus.Type.LEVELCHUNK) {
|
|
|
|
+ // Paper end
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2019-06-25 01:47:58 +00:00
|
|
|
2.22.0
|
2019-06-22 20:17:40 +00:00
|
|
|
|