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

This commit is contained in:
Sander Knauff 2020-11-06 18:46:21 +11:00 committed by md_5
parent 3eb7236e44
commit 2fc37bcc05
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

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