Paper/patches/server/0800-Fix-saving-in-unloadWorld.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

21 lines
973 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Philip Kelley <philip@thoriumcube.org>
Date: Wed, 16 Mar 2022 12:05:59 +0000
Subject: [PATCH] Fix saving in unloadWorld
Change savingDisabled to false to ensure ServerLevel's saving logic gets called when unloadWorld is called with save = true
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b5f8cac05b00550ff26ac3e470d11708d829ed23..7dbb0acda9fff69a850c72eb88ad69a1584569be 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1325,7 +1325,7 @@ public final class CraftServer implements Server {
try {
if (save) {
- handle.save(null, true, true);
+ handle.save(null, true, false); // Paper - don't disable saving
}
handle.getChunkSource().close(save);