Paper/patches/unapplied/server/0816-Put-world-into-worldli...

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 8ac653bbf61015a38343d54f1009c1d935833546..b3e272bf7329a17094850e2fac9ee0c69d5e045d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -601,9 +601,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
+ this.addLevel(world); // Paper - move up
this.initWorld(world, worlddata, worldData, worlddata.worldGenSettings());
- this.addLevel(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 049ce463c8da4f0730edf5a03439685eb547433e..793eae3ab4d144b90ad01099a2c0e90afc53a641 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1241,10 +1241,11 @@ public final class CraftServer implements Server {
return null;
}
+ this.console.addLevel(internal); // Paper - move up
this.console.initWorld(internal, worlddata, worlddata, worlddata.worldGenSettings());
internal.setSpawnSettings(true, true);
- this.console.addLevel(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 // Paper - rewrite chunk system