SPIGOT-6197: Prevent world loading from updating spawn settings of all worlds

By: Sander Knauff <sanderknauff@hotmail.com>
This commit is contained in:
CraftBukkit/Spigot 2020-11-06 18:46:21 +11:00
parent 7b5ac02c82
commit f602441c1d

View file

@ -435,7 +435,7 @@
if (forcedchunk != null) {
LongIterator longiterator = forcedchunk.a().iterator();
@@ -416,11 +610,17 @@
@@ -416,11 +610,18 @@
}
}
@ -447,15 +447,17 @@
+ // CraftBukkit end
worldloadlistener.b();
chunkproviderserver.getLightEngine().a(5);
this.bc();
+
- this.bc();
+ // CraftBukkit start
+ // this.bc();
+ worldserver.setSpawnFlags(this.getSpawnMonsters(), this.getSpawnAnimals());
+
+ this.forceTicks = false;
+ // CraftBukkit end
}
protected void loadResourcesZip() {
@@ -465,12 +665,16 @@
@@ -465,12 +666,16 @@
worldserver.save((IProgressUpdate) null, flag1, worldserver.savingDisabled && !flag2);
}
@ -472,7 +474,7 @@
return flag3;
}
@@ -479,8 +683,29 @@
@@ -479,8 +684,29 @@
this.stop();
}
@ -502,7 +504,7 @@
if (this.getServerConnection() != null) {
this.getServerConnection().b();
}
@@ -489,6 +714,7 @@
@@ -489,6 +715,7 @@
MinecraftServer.LOGGER.info("Saving players");
this.playerList.savePlayers();
this.playerList.shutdown();
@ -510,7 +512,7 @@
}
MinecraftServer.LOGGER.info("Saving worlds");
@@ -566,14 +792,16 @@
@@ -566,14 +793,16 @@
while (this.isRunning) {
long i = SystemUtils.getMonotonicMillis() - this.nextTick;
@ -528,7 +530,7 @@
this.nextTick += 50L;
GameProfilerTick gameprofilertick = GameProfilerTick.a("Server");
@@ -619,6 +847,12 @@
@@ -619,6 +848,12 @@
} catch (Throwable throwable1) {
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
} finally {
@ -541,7 +543,7 @@
this.exit();
}
@@ -627,8 +861,15 @@
@@ -627,8 +862,15 @@
}
private boolean canSleepForTick() {
@ -558,7 +560,7 @@
protected void sleepForTick() {
this.executeAll();
@@ -734,7 +975,7 @@
@@ -734,7 +976,7 @@
this.serverPing.b().a(agameprofile);
}
@ -567,7 +569,7 @@
MinecraftServer.LOGGER.debug("Autosave started");
this.methodProfiler.enter("save");
this.playerList.savePlayers();
@@ -764,22 +1005,39 @@
@@ -764,22 +1006,39 @@
}
protected void b(BooleanSupplier booleansupplier) {
@ -607,7 +609,7 @@
this.methodProfiler.enter("tick");
@@ -863,7 +1121,7 @@
@@ -863,7 +1122,7 @@
}
public String getServerModName() {
@ -616,7 +618,7 @@
}
public CrashReport b(CrashReport crashreport) {
@@ -1220,16 +1478,17 @@
@@ -1220,16 +1479,17 @@
public CompletableFuture<Void> a(Collection<String> collection) {
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
@ -636,7 +638,7 @@
this.resourcePackRepository.a(collection);
this.saveData.a(a(this.resourcePackRepository));
datapackresources.i();
@@ -1595,6 +1854,22 @@
@@ -1595,6 +1855,22 @@
}