Paper/patches/server/0816-WorldCreator-keepSpawnLoaded.patch
BlockyTheDev 6dc8e30c92
Fix startup and runtime crashes (experimental branch) (#9606)
* Fix startup error

* Fix runtime error

- The code with '.getKey().getKey().getKey()' looks a bit strange but is necessary so the results on the timings website are the same as before. It gets the key (String) from the NamespacedKey, of the key from the Keyed, from the key of the Map.Entry.

* [ci skip] Add myself to LICENSE.md

* Remove wildcard import

* Revert import order
2023-08-15 09:41:56 -07:00

19 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 3 Jul 2021 21:18:28 +0100
Subject: [PATCH] WorldCreator#keepSpawnLoaded
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 7dbb0acda9fff69a850c72eb88ad69a1584569be..68a218152d3ac11732ee873d00c184a4fa5a88df 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1284,6 +1284,7 @@ public final class CraftServer implements Server {
internal.setSpawnSettings(true, true);
// Paper - move up
+ internal.keepSpawnInMemory = creator.keepSpawnLoaded().toBooleanOrElse(internal.getWorld().getKeepSpawnInMemory()); // Paper
this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal);
//internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API // Paper - rewrite chunk system