From c905a715e997d0c008bacee0da2cc52e953b2449 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 26 Dec 2024 17:04:55 +1100 Subject: [PATCH] SPIGOT-7989: Error loading very old chunks --- .../minecraft/world/level/chunk/storage/IChunkLoader.patch | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nms-patches/net/minecraft/world/level/chunk/storage/IChunkLoader.patch b/nms-patches/net/minecraft/world/level/chunk/storage/IChunkLoader.patch index 38001e3b9..ad8619c4f 100644 --- a/nms-patches/net/minecraft/world/level/chunk/storage/IChunkLoader.patch +++ b/nms-patches/net/minecraft/world/level/chunk/storage/IChunkLoader.patch @@ -16,7 +16,7 @@ public class IChunkLoader implements AutoCloseable { public static final int LAST_MONOLYTH_STRUCTURE_DATA_VERSION = 1493; -@@ -39,13 +48,57 @@ +@@ -39,13 +48,56 @@ return this.worker.isOldChunkAround(chunkcoordintpair, i); } @@ -25,7 +25,6 @@ + private boolean check(ChunkProviderServer cps, int x, int z) { + ChunkCoordIntPair pos = new ChunkCoordIntPair(x, z); + if (cps != null) { -+ com.google.common.base.Preconditions.checkState(org.bukkit.Bukkit.isPrimaryThread(), "primary thread"); + if (cps.hasChunk(x, z)) { + return true; + } @@ -75,7 +74,7 @@ if (i < 1493) { nbttagcompound = DataFixTypes.CHUNK.update(this.fixerUpper, nbttagcompound, i, 1493); if (nbttagcompound.getCompound("Level").getBoolean("hasLegacyStructureData")) { -@@ -70,7 +123,7 @@ +@@ -70,7 +122,7 @@ } } @@ -84,7 +83,7 @@ PersistentStructureLegacy persistentstructurelegacy = this.legacyStructureHandler; if (persistentstructurelegacy == null) { -@@ -85,7 +138,7 @@ +@@ -85,7 +137,7 @@ return persistentstructurelegacy; }