From 3331dade5e3dee09e2089d04d28bc0d4a929c060 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 28 Apr 2019 11:13:44 +1000 Subject: [PATCH] SPIGOT-4790: Secondary world data not saved --- nms-patches/MinecraftServer.patch | 35 +++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/nms-patches/MinecraftServer.patch b/nms-patches/MinecraftServer.patch index 80a20100a0..f2d80e21c9 100644 --- a/nms-patches/MinecraftServer.patch +++ b/nms-patches/MinecraftServer.patch @@ -253,27 +253,27 @@ + if (worlddata.getCustomBossEvents() != null) { + this.getBossBattleCustomData().a(worlddata.getCustomBossEvents()); + } -+ } + } + this.a(this.getDifficulty(), true); + for (WorldServer worldserver : this.getWorlds()) { + this.loadSpawn(worldserver.getChunkProvider().playerChunkMap.worldLoadListener, worldserver); - } - -- WorldServer worldserver = new WorldServer(this, this.executorService, worldnbtstorage, worlddata, DimensionManager.OVERWORLD, this.methodProfiler, worldloadlistener); ++ } ++ + this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD); + this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP)); + // CraftBukkit end -- this.worldServer.put(DimensionManager.OVERWORLD, worldserver); -- this.initializeScoreboards(worldserver.getWorldPersistentData()); -- worldserver.getWorldBorder().b(worlddata); -- WorldServer worldserver1 = this.getWorldServer(DimensionManager.OVERWORLD); +- WorldServer worldserver = new WorldServer(this, this.executorService, worldnbtstorage, worlddata, DimensionManager.OVERWORLD, this.methodProfiler, worldloadlistener); + } + + // CraftBukkit start + public void initWorld(WorldServer worldserver1, WorldData worlddata, WorldSettings worldsettings) { + worldserver1.getWorldBorder().b(worlddata); -+ + +- this.worldServer.put(DimensionManager.OVERWORLD, worldserver); +- this.initializeScoreboards(worldserver.getWorldPersistentData()); +- worldserver.getWorldBorder().b(worlddata); +- WorldServer worldserver1 = this.getWorldServer(DimensionManager.OVERWORLD); + // CraftBukkit start + if (worldserver1.generator != null) { + worldserver1.getWorld().getPopulators().addAll(worldserver1.generator.getDefaultPopulators(worldserver1.getWorld())); @@ -402,6 +402,23 @@ } protected void a(String s, WorldNBTStorage worldnbtstorage) { +@@ -450,14 +625,14 @@ + } catch (ExceptionWorldConflict exceptionworldconflict) { + MinecraftServer.LOGGER.warn(exceptionworldconflict.getMessage()); + } +- } + +- WorldServer worldserver1 = this.getWorldServer(DimensionManager.OVERWORLD); ++ WorldServer worldserver1 = worldserver; // CraftBukkit + WorldData worlddata = worldserver1.getWorldData(); + + worldserver1.getWorldBorder().a(worlddata); + worlddata.c(this.getBossBattleCustomData().c()); + worldserver1.getDataManager().saveWorldData(worlddata, this.getPlayerList().r()); ++ } // CraftBukkit - moved down + return flag3; + } + @@ -466,8 +641,29 @@ this.stop(); }