Paper/patches/api/0192-Disable-Sync-Events-firing-Async-errors-during-shutd.patch

26 lines
1.4 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 11 Apr 2020 21:38:59 -0400
Subject: [PATCH] Disable Sync Events firing Async errors during shutdown
This is how it use to behave on Paper, and this is totally destroying
the ability to try to shut the server down gracefully during the
shutdown process as events firing on the watchdog thread are throwing
errors.
This isn't an issue on Spigot
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
2021-11-24 11:04:30 +01:00
index 3457dd6a86f927dd38edd200121aad5364d8abd5..0d9d729a18b5388b06ab0a3749e55f91f838be88 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
2021-11-24 11:04:30 +01:00
@@ -605,7 +605,7 @@ public final class SimplePluginManager implements PluginManager {
2021-06-11 14:02:28 +02:00
// Paper - replace callEvent by merging to below method
if (event.isAsynchronous() && server.isPrimaryThread()) {
throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
- } else if (!event.isAsynchronous() && !server.isPrimaryThread()) {
+ } else if (!event.isAsynchronous() && !server.isPrimaryThread() && !server.isStopping() ) {
throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
}