From d652ff68f27b2fae4428c9dca333c5566a886cf8 Mon Sep 17 00:00:00 2001 From: Noah van der Aa Date: Fri, 1 Jul 2022 18:14:50 +0200 Subject: [PATCH] Don't allow world unloading while ticking worlds (fixes #8080) (#8081) --- ...row-exception-on-world-create-while-being-ticked.patch | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/patches/server/Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/Throw-exception-on-world-create-while-being-ticked.patch index 5eb47793a2..1a58a48530 100644 --- a/patches/server/Throw-exception-on-world-create-while-being-ticked.patch +++ b/patches/server/Throw-exception-on-world-create-while-being-ticked.patch @@ -46,3 +46,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 Validate.notNull(creator, "Creator may not be null"); String name = creator.name(); +@@ -0,0 +0,0 @@ public final class CraftServer implements Server { + + @Override + public boolean unloadWorld(World world, boolean save) { ++ Preconditions.checkState(!this.console.isIteratingOverLevels, "Cannot unload a world while worlds are being ticked"); // Paper + if (world == null) { + return false; + }