From b6c3d89496cbf96b629b87684947b8e62acca232 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 22 Sep 2018 11:32:38 -0400 Subject: [PATCH] Revert "All generated chunks should be loadable" - Fixes #1470 This reverts commit 60b1ed9c763f8808ca8ab0c408f4c9591fd6f2d1. --- ...-Generated-chunks-should-be-loadable.patch | 27 ------------------- ...loadChunk-int-int-false-load-unconve.patch | 23 ++++++++++++++++ 2 files changed, 23 insertions(+), 27 deletions(-) delete mode 100644 Spigot-Server-Patches/0358-Generated-chunks-should-be-loadable.patch create mode 100644 Spigot-Server-Patches/0358-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch diff --git a/Spigot-Server-Patches/0358-Generated-chunks-should-be-loadable.patch b/Spigot-Server-Patches/0358-Generated-chunks-should-be-loadable.patch deleted file mode 100644 index 3e904ebf99..0000000000 --- a/Spigot-Server-Patches/0358-Generated-chunks-should-be-loadable.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 7fd668e77664499c5012e01109165eab285c49a0 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 -@@ -115,7 +115,7 @@ 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)); --- -2.19.0 - diff --git a/Spigot-Server-Patches/0358-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/Spigot-Server-Patches/0358-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch new file mode 100644 index 0000000000..a716a71459 --- /dev/null +++ b/Spigot-Server-Patches/0358-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch @@ -0,0 +1,23 @@ +From 2a88ed3c018acbbe5ce52bdfa74148920cc757a4 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 6b46b97c88..3bd32ef3e9 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -296,7 +296,7 @@ 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) { +-- +2.19.0 +