2019-08-05 18:35:40 +02:00
|
|
|
From ced736fc443de0c3b20f67e4781b14aa63ecf6f9 Mon Sep 17 00:00:00 2001
|
2019-06-22 22:17:40 +02: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-08-05 18:35:40 +02:00
|
|
|
index bdadbd436e..fbbd4d5dd0 100644
|
2019-06-22 22:17:40 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
2019-07-28 02:38:29 +02:00
|
|
|
@@ -768,8 +768,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
2019-06-22 22:17:40 +02: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 08:52:08 +02:00
|
|
|
+ ChunkStatus statusOnDisk = this.getChunkStatusOnDisk(chunkcoordintpair);
|
2019-06-22 22:17:40 +02:00
|
|
|
+ if (statusOnDisk != null && statusOnDisk.getType() == ChunkStatus.Type.LEVELCHUNK) {
|
|
|
|
+ // Paper end
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2019-06-25 03:47:58 +02:00
|
|
|
2.22.0
|
2019-06-22 22:17:40 +02:00
|
|
|
|