From d0e9b66d4ac52ba0aaf2a6a665bb796d7a4daef2 Mon Sep 17 00:00:00 2001 From: mastermc05 Date: Mon, 8 Aug 2022 11:00:32 +0300 Subject: [PATCH] Try to fix https://github.com/webbukkit/dynmap/issues/3819 --- .../dynmap/bukkit/helper/v118_2/AsyncChunkProvider118_2.java | 2 ++ .../org/dynmap/bukkit/helper/v119/AsyncChunkProvider119.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/bukkit-helper-118-2/src/main/java/org/dynmap/bukkit/helper/v118_2/AsyncChunkProvider118_2.java b/bukkit-helper-118-2/src/main/java/org/dynmap/bukkit/helper/v118_2/AsyncChunkProvider118_2.java index 745527e6..947b4424 100644 --- a/bukkit-helper-118-2/src/main/java/org/dynmap/bukkit/helper/v118_2/AsyncChunkProvider118_2.java +++ b/bukkit-helper-118-2/src/main/java/org/dynmap/bukkit/helper/v118_2/AsyncChunkProvider118_2.java @@ -96,6 +96,8 @@ public class AsyncChunkProvider118_2 { try { return getAsyncSaveData.invoke(null, world.getHandle(), c); } catch (IllegalAccessException | InvocationTargetException e) { + //Save as from main thread + if (((CraftServer) Bukkit.getServer()).getServer().hasStopped()) return null; throw new RuntimeException(e); } }, ((CraftServer) Bukkit.getServer()).getServer()); diff --git a/bukkit-helper-119/src/main/java/org/dynmap/bukkit/helper/v119/AsyncChunkProvider119.java b/bukkit-helper-119/src/main/java/org/dynmap/bukkit/helper/v119/AsyncChunkProvider119.java index ac93ee97..bbd907ed 100644 --- a/bukkit-helper-119/src/main/java/org/dynmap/bukkit/helper/v119/AsyncChunkProvider119.java +++ b/bukkit-helper-119/src/main/java/org/dynmap/bukkit/helper/v119/AsyncChunkProvider119.java @@ -95,6 +95,8 @@ public class AsyncChunkProvider119 { try { return getAsyncSaveData.invoke(null, world.getHandle(), c); } catch (ReflectiveOperationException e) { + //Save as from main thread + if (((CraftServer) Bukkit.getServer()).getServer().hasStopped()) return null; throw new RuntimeException(e); } }, ((CraftServer) Bukkit.getServer()).getServer());