From 6483b1a44f754eb8c16a12ca3e86a151d8a7e5a6 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 21 Sep 2018 16:59:20 -0400 Subject: [PATCH] All generated chunks should be loadable Some chunks that need conversion may fail the loadChunks pass, and end up entering the world gen code to finish processing. We solved this on the API level before, but this needs to apply to all chunk loads when gen=false --- .../Generated-chunks-should-be-loadable.patch | 25 +++++++++++++++++++ ...loadChunk-int-int-false-load-unconve.patch | 21 ---------------- 2 files changed, 25 insertions(+), 21 deletions(-) create mode 100644 Spigot-Server-Patches/Generated-chunks-should-be-loadable.patch delete mode 100644 Spigot-Server-Patches/Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch diff --git a/Spigot-Server-Patches/Generated-chunks-should-be-loadable.patch b/Spigot-Server-Patches/Generated-chunks-should-be-loadable.patch new file mode 100644 index 0000000000..a128343092 --- /dev/null +++ b/Spigot-Server-Patches/Generated-chunks-should-be-loadable.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Fri, 21 Sep 2018 15:50:48 -0400 +Subject: [PATCH] Generated chunks should be loadable + +Some chunks that need conversion may fail the loadChunks pass, and +end up entering the world gen code to finish processing. + +We solved this on the API level before, but this needs to apply to +all chunk loads when gen=false + +diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java +index 99613b2ef3..2e9206eee8 100644 +--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { + if (chunk != null) { + this.asyncTaskHandler.postToMainThread(chunk::addEntities); + return chunk; +- } else if (flag1) { ++ } else if (flag1 || (flag && isChunkGenerated(i, j))) { // Paper - chunk conversions can be treated as generations + try (co.aikar.timings.Timing timing = world.timings.chunkGeneration.startTiming()) { // Paper + this.batchScheduler.b(); + this.batchScheduler.a(new ChunkCoordIntPair(i, j)); +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/Spigot-Server-Patches/Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch deleted file mode 100644 index 1f0c775bf6..0000000000 --- a/Spigot-Server-Patches/Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Spottedleaf -Date: Sun, 2 Sep 2018 19:34:33 -0700 -Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted - chunks - - -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b411776c3c..262363999d 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -0,0 +0,0 @@ public class CraftWorld implements World { - public boolean loadChunk(int x, int z, boolean generate) { - org.spigotmc.AsyncCatcher.catchOp( "chunk load"); // Spigot - chunkLoadCount++; -- return world.getChunkProviderServer().getChunkAt(x, z, true, generate) != null; -+ return world.getChunkProviderServer().getChunkAt(x, z, true, generate || isChunkGenerated(x, z)) != null; // Paper - } - - public boolean isChunkLoaded(Chunk chunk) { --- \ No newline at end of file