SPIGOT-5103: World.save does not save gamerules
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -263,17 +263,17 @@
|
||||
+ this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
|
||||
+ this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ // 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
|
||||
+ public void initWorld(WorldServer worldserver1, WorldData worlddata, WorldSettings worldsettings) {
|
||||
+ worldserver1.getWorldBorder().b(worlddata);
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ if (worldserver1.generator != null) {
|
||||
+ worldserver1.getWorld().getPopulators().addAll(worldserver1.generator.getDefaultPopulators(worldserver1.getWorld()));
|
||||
@@ -405,24 +405,24 @@
|
||||
}
|
||||
|
||||
protected void a(String s, WorldNBTStorage worldnbtstorage) {
|
||||
@@ -449,14 +627,14 @@
|
||||
} catch (ExceptionWorldConflict exceptionworldconflict) {
|
||||
MinecraftServer.LOGGER.warn(exceptionworldconflict.getMessage());
|
||||
@@ -451,12 +629,16 @@
|
||||
}
|
||||
- }
|
||||
}
|
||||
|
||||
- WorldServer worldserver1 = this.getWorldServer(DimensionManager.OVERWORLD);
|
||||
+ WorldServer worldserver1 = worldserver; // CraftBukkit
|
||||
+ // CraftBukkit start - moved to WorldServer.save
|
||||
+ /*
|
||||
WorldServer worldserver1 = this.getWorldServer(DimensionManager.OVERWORLD);
|
||||
WorldData worlddata = worldserver1.getWorldData();
|
||||
|
||||
worldserver1.getWorldBorder().a(worlddata);
|
||||
worlddata.c(this.getBossBattleCustomData().c());
|
||||
worldserver1.getDataManager().saveWorldData(worlddata, this.getPlayerList().r());
|
||||
+ } // CraftBukkit - moved down
|
||||
+ */
|
||||
+ // CraftBukkit end
|
||||
return flag3;
|
||||
}
|
||||
|
||||
@@ -465,8 +643,29 @@
|
||||
@@ -465,8 +647,29 @@
|
||||
this.stop();
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@
|
||||
if (this.getServerConnection() != null) {
|
||||
this.getServerConnection().b();
|
||||
}
|
||||
@@ -475,6 +674,7 @@
|
||||
@@ -475,6 +678,7 @@
|
||||
MinecraftServer.LOGGER.info("Saving players");
|
||||
this.playerList.savePlayers();
|
||||
this.playerList.shutdown();
|
||||
@@ -460,7 +460,7 @@
|
||||
}
|
||||
|
||||
MinecraftServer.LOGGER.info("Saving worlds");
|
||||
@@ -544,14 +744,16 @@
|
||||
@@ -544,14 +748,16 @@
|
||||
while (this.isRunning) {
|
||||
long i = SystemUtils.getMonotonicMillis() - this.nextTick;
|
||||
|
||||
@@ -478,7 +478,7 @@
|
||||
this.nextTick += 50L;
|
||||
if (this.S) {
|
||||
this.S = false;
|
||||
@@ -598,6 +800,12 @@
|
||||
@@ -598,6 +804,12 @@
|
||||
} catch (Throwable throwable1) {
|
||||
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
|
||||
} finally {
|
||||
@@ -491,7 +491,7 @@
|
||||
this.exit();
|
||||
}
|
||||
|
||||
@@ -606,8 +814,15 @@
|
||||
@@ -606,8 +818,15 @@
|
||||
}
|
||||
|
||||
private boolean canSleepForTick() {
|
||||
@@ -508,7 +508,7 @@
|
||||
|
||||
protected void sleepForTick() {
|
||||
this.executeAll();
|
||||
@@ -708,7 +923,7 @@
|
||||
@@ -708,7 +927,7 @@
|
||||
this.serverPing.b().a(agameprofile);
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@
|
||||
MinecraftServer.LOGGER.debug("Autosave started");
|
||||
this.methodProfiler.enter("save");
|
||||
this.playerList.savePlayers();
|
||||
@@ -738,23 +953,40 @@
|
||||
@@ -738,23 +957,40 @@
|
||||
}
|
||||
|
||||
protected void b(BooleanSupplier booleansupplier) {
|
||||
@@ -559,7 +559,7 @@
|
||||
|
||||
this.methodProfiler.enter("tick");
|
||||
|
||||
@@ -793,7 +1025,8 @@
|
||||
@@ -793,7 +1029,8 @@
|
||||
this.tickables.add(runnable);
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@
|
||||
OptionParser optionparser = new OptionParser();
|
||||
OptionSpec<Void> optionspec = optionparser.accepts("nogui");
|
||||
OptionSpec<Void> optionspec1 = optionparser.accepts("initSettings", "Initializes 'server.properties' and 'eula.txt', then quits");
|
||||
@@ -816,15 +1049,17 @@
|
||||
@@ -816,15 +1053,17 @@
|
||||
optionparser.printHelpOn(System.err);
|
||||
return;
|
||||
}
|
||||
@@ -589,7 +589,7 @@
|
||||
MinecraftServer.LOGGER.info("Initialized '" + java_nio_file_path.toAbsolutePath().toString() + "' and '" + java_nio_file_path1.toAbsolutePath().toString() + "'");
|
||||
return;
|
||||
}
|
||||
@@ -836,14 +1071,15 @@
|
||||
@@ -836,14 +1075,15 @@
|
||||
|
||||
DispenserRegistry.init();
|
||||
DispenserRegistry.c();
|
||||
@@ -608,7 +608,7 @@
|
||||
dedicatedserver.i((String) optionset.valueOf(optionspec7));
|
||||
dedicatedserver.setPort((Integer) optionset.valueOf(optionspec10));
|
||||
dedicatedserver.e(optionset.has(optionspec2));
|
||||
@@ -866,6 +1102,29 @@
|
||||
@@ -866,6 +1106,29 @@
|
||||
|
||||
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(MinecraftServer.LOGGER));
|
||||
Runtime.getRuntime().addShutdownHook(thread);
|
||||
@@ -638,7 +638,7 @@
|
||||
} catch (Exception exception) {
|
||||
MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception);
|
||||
}
|
||||
@@ -885,7 +1144,9 @@
|
||||
@@ -885,7 +1148,9 @@
|
||||
}
|
||||
|
||||
public void startServerThread() {
|
||||
@@ -648,7 +648,7 @@
|
||||
}
|
||||
|
||||
public File d(String s) {
|
||||
@@ -940,7 +1201,7 @@
|
||||
@@ -940,7 +1205,7 @@
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
@@ -657,7 +657,7 @@
|
||||
}
|
||||
|
||||
public CrashReport b(CrashReport crashreport) {
|
||||
@@ -979,7 +1240,7 @@
|
||||
@@ -979,7 +1244,7 @@
|
||||
}
|
||||
|
||||
public boolean E() {
|
||||
@@ -666,7 +666,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1482,4 +1743,16 @@
|
||||
@@ -1482,4 +1747,16 @@
|
||||
}
|
||||
|
||||
public abstract boolean b(GameProfile gameprofile);
|
||||
|
||||
Reference in New Issue
Block a user