Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-16 19:40:07 +01:00
e4602b6d48
This patch appears to be no longer relevant, and is seemingly a leading cause of datapack performance being horrific
29 Zeilen
1.4 KiB
Diff
29 Zeilen
1.4 KiB
Diff
From ec3ea5e0e353c0e0da2ef3289d63048cff77b89d 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 04728dca7..72ae46eab 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
|
@@ -843,8 +843,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.1
|
|
|