From 2fc37bcc0564c60482b62269c4eb61988b2a7603 Mon Sep 17 00:00:00 2001 From: Sander Knauff Date: Fri, 6 Nov 2020 18:46:21 +1100 Subject: [PATCH] SPIGOT-6197: Prevent world loading from updating spawn settings of all worlds --- nms-patches/MinecraftServer.patch | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/nms-patches/MinecraftServer.patch b/nms-patches/MinecraftServer.patch index 5f1a9ae17..21fdfe1f7 100644 --- a/nms-patches/MinecraftServer.patch +++ b/nms-patches/MinecraftServer.patch @@ -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 a(Collection collection) { CompletableFuture 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 @@ }