aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJake <[email protected]>2021-11-28 12:35:21 -0800
committerMiniDigger | Martin <[email protected]>2021-11-30 19:26:33 +0100
commitd3ffbcdd52d67ff70c8116c749c2a581a02c33ff (patch)
tree4566905ba4c5a7ee2038bdcefc5a1b5f5a9eb921
parenta372cea5d26fd21bee9b3411fbd41b7601e420f6 (diff)
downloadPaper-d3ffbcdd52d67ff70c8116c749c2a581a02c33ff.tar.gz
Paper-d3ffbcdd52d67ff70c8116c749c2a581a02c33ff.zip
Fixes chunks not loading PDC sometimes
If a chunk had no entities or block entities, it would fail to load the PDC. This adds an additional check to see if there is PDC and then to load that if so. See: https://hub.spigotmc.org/jira/browse/SPIGOT-6814
-rw-r--r--patches/server/0811-Load-chunk-PDC-if-present.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/patches/server/0811-Load-chunk-PDC-if-present.patch b/patches/server/0811-Load-chunk-PDC-if-present.patch
new file mode 100644
index 0000000000..b3090adaf6
--- /dev/null
+++ b/patches/server/0811-Load-chunk-PDC-if-present.patch
@@ -0,0 +1,21 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake <[email protected]>
+Date: Sun, 28 Nov 2021 12:34:51 -0800
+Subject: [PATCH] Load chunk PDC if present
+
+
+diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+index e072a895ed71bb2e98a3a0c4aef37418c7c39f41..c7f9e155b14beab5b0ba1d4debddc9747f13675d 100644
+--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
++++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+@@ -687,8 +687,9 @@ public class ChunkSerializer {
+ private static LevelChunk.PostLoadProcessor postLoadChunk(ServerLevel world, CompoundTag nbt) {
+ ListTag nbttaglist = ChunkSerializer.getListOfCompoundsOrNull(nbt, "entities");
+ ListTag nbttaglist1 = ChunkSerializer.getListOfCompoundsOrNull(nbt, "block_entities");
++ boolean hasPdc = nbt.contains("ChunkBukkitValues", Tag.TAG_COMPOUND); // Paper
+
+- return nbttaglist == null && nbttaglist1 == null ? null : (chunk) -> {
++ return nbttaglist == null && nbttaglist1 == null && !hasPdc ? null : (chunk) -> { // Paper
+ if (nbttaglist != null) {
+ world.addLegacyChunkEntities(EntityType.loadEntitiesRecursive(nbttaglist, world));
+ }