aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0711-Put-world-into-worldlist-before-initing-the-world.patch
blob: 998c2caea6fb0b62afa2a470a9e91a143c166c7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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 239b1616ddd4cb64a0565d0f8f3bef7bbaaf23c9..39735cce3c32d9905130dca2d7e34aff144364ef 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -629,9 +629,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 ddf3ce680bc8c69647a89ee46fd1547e566a61b8..f629991fa998d4dab89ed5c3d26b1b7a4f85b5cb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1295,10 +1295,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