Paper/patches/server/0871-Put-world-into-worldlist-before-initing-the-world.patch
Shane Freeder c6ea84c7fa
Drop unneeded desync patch
spigot no longer even fires the event for this case, so, this may
actually be a regression, not too sure here, but, as-is this patch
is dead
2022-03-02 09:44:22 +00:00

42 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Tue, 22 Feb 2022 14:21:35 -0800
Subject: [PATCH] Put world into worldlist before initing the world
Some parts of legacy conversion will need the overworld
to get the legacy structure data storage
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 115e06e0c6865f1c04f58a74509332f7c5043d91..f60120f788bdd1e1a159b87c18655d9e00920c89 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -631,9 +631,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
+ this.levels.put(world.dimension(), world); // Paper - move up
this.initWorld(world, worlddata, worldData, worlddata.worldGenSettings());
- this.levels.put(world.dimension(), world);
+ // Paper - move up
this.getPlayerList().addWorldborderListener(world);
if (worlddata.getCustomBossEvents() != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 197668e1b8487ed5463d457c8738ba70813cace1..557121d00eb47c29779a1a076cbc4ba0f61a548a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1248,10 +1248,11 @@ public final class CraftServer implements Server {
return null;
}
+ console.levels.put(internal.dimension(), internal); // Paper - move up
this.console.initWorld(internal, worlddata, worlddata, worlddata.worldGenSettings());
internal.setSpawnSettings(true, true);
- console.levels.put(internal.dimension(), internal);
+ // Paper - move up
this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal);
internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API