SPIGOT-4790: Secondary world data not saved

This commit is contained in:
md_5 2019-04-28 11:13:44 +10:00
parent f4f32958a8
commit 3331dade5e

View File

@ -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();
}