Skip to content

Commit 854f3d3

Browse files
committed
Put world into worldlist before initing the world
Some parts of legacy conversion will need the overworld to get the legacy structure data storage
1 parent cdb893b commit 854f3d3

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
3+
Date: Tue, 22 Feb 2022 14:21:35 -0800
4+
Subject: [PATCH] Put world into worldlist before initing the world
5+
6+
Some parts of legacy conversion will need the overworld
7+
to get the legacy structure data storage
8+
9+
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
10+
index 1674deebbeab0995ed7acacf8052e1daf4d2a7bc..053dbe5eef6574cfe98ab7499181bdd83a81f2e1 100644
11+
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
12+
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
13+
@@ -693,9 +693,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
14+
}
15+
16+
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
17+
+ this.levels.put(world.dimension(), world); // Paper - move up
18+
this.initWorld(world, worlddata, worldData, worlddata.worldGenSettings());
19+
20+
- this.levels.put(world.dimension(), world);
21+
+ // Paper - move up
22+
this.getPlayerList().addWorldborderListener(world);
23+
24+
if (worlddata.getCustomBossEvents() != null) {
25+
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
26+
index dbbae437123163c60c3f60a48043967a8adbd124..caeaf2978d7a8b7f2d1595e102f2751d837172b4 100644
27+
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
28+
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
29+
@@ -1255,10 +1255,11 @@ public final class CraftServer implements Server {
30+
return null;
31+
}
32+
33+
+ console.levels.put(internal.dimension(), internal); // Paper - move up
34+
this.console.initWorld(internal, worlddata, worlddata, worlddata.worldGenSettings());
35+
36+
internal.setSpawnSettings(true, true);
37+
- console.levels.put(internal.dimension(), internal);
38+
+ // Paper - move up
39+
40+
this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal);
41+
internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API

0 commit comments

Comments
 (0)