3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 11:00:06 +01:00

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
Dieser Commit ist enthalten in:
Aikar 2018-09-21 16:59:20 -04:00
Ursprung 7438edc9a1
Commit 60b1ed9c76
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 401ADFC9891FAAFE
2 geänderte Dateien mit 27 neuen und 23 gelöschten Zeilen

Datei anzeigen

@ -0,0 +1,27 @@
From 7fd668e77664499c5012e01109165eab285c49a0 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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

Datei anzeigen

@ -1,23 +0,0 @@
From 69295bb452ceab708218850cfcad6d5b03d9a44b Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
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
@@ -295,7 +295,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