mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 04:02:50 +01:00
19de9af63c
Functional GUI fix added by billygalbreath
28 lines
1.4 KiB
Diff
28 lines
1.4 KiB
Diff
From 81ca8a38e7ed63416c92b49cfcabeba9ed3edc1c Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 6257eafe0..4e9edd759 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
|
@@ -783,8 +783,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
|
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.getChunkStatusOnDisk(chunkcoordintpair);
|
|
+ if (statusOnDisk != null && statusOnDisk.getType() == ChunkStatus.Type.LEVELCHUNK) {
|
|
+ // Paper end
|
|
return false;
|
|
}
|
|
|
|
--
|
|
2.25.0.windows.1
|
|
|