Paper/patches/server/0692-Put-world-into-worldlist-before-initing-the-world.patch
2024-04-25 22:34:46 +02:00

42 lines
2.3 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 644f178438863295754c2b72339ce7f9066674b9..ea442883eda28e5673cef9470145d5c40ac66159 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -640,9 +640,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
+ this.addLevel(world); // Paper - Put world into worldlist before initing the world; move up
this.initWorld(world, worlddata, this.worldData, worldoptions);
- this.addLevel(world);
+ // Paper - Put world into worldlist before initing the world; 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 ec6dd3cd685421e24293c4b6a3a01c5dd37cc620..e25dc948bfd59b8d0a9350c0ffe496f53d042ab8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1301,10 +1301,11 @@ public final class CraftServer implements Server {
return null;
}
+ this.console.addLevel(internal); // Paper - Put world into worldlist before initing the world; move up
this.console.initWorld(internal, worlddata, worlddata, worlddata.worldGenOptions());
internal.setSpawnSettings(true, true);
- this.console.addLevel(internal);
+ // Paper - Put world into worldlist before initing the world; 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