From 03d3b417087280def5d5108eae9c48d5412395fc Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 1 May 2019 18:10:27 +1000 Subject: [PATCH] SPIGOT-4822: Existing world fails to load By: md_5 --- .../src/main/java/org/bukkit/craftbukkit/CraftServer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 88a24de2d9..8f9814263b 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -908,7 +908,8 @@ public final class CraftServer implements Server { WorldNBTStorage sdm = new WorldNBTStorage(getWorldContainer(), name, getServer(), getHandle().getServer().dataConverterManager); WorldData worlddata = sdm.getWorldData(); - WorldSettings worldSettings = null; + WorldSettings worldSettings; + // See MinecraftServer.a(String, String, long, WorldType, JsonElement) if (worlddata == null) { worldSettings = new WorldSettings(creator.seed(), EnumGamemode.getById(getDefaultGameMode().getValue()), generateStructures, hardcore, type); JsonElement parsedSettings = new JsonParser().parse(creator.generatorSettings()); @@ -916,8 +917,10 @@ public final class CraftServer implements Server { worldSettings.setGeneratorSettings(parsedSettings.getAsJsonObject()); } worlddata = new WorldData(worldSettings, name); + } else { + worlddata.a(name); + worldSettings = new WorldSettings(worlddata); } - worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end) DimensionManager actualDimension = DimensionManager.a(creator.environment().getId()); DimensionManager internalDimension = new DimensionManager(dimension, name, name, (w, manager) -> actualDimension.getWorldProvider(w), actualDimension.hasSkyLight());