mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 20:23:53 -07:00
Fix Folia scheduler tasks not canceling when plugin disable (#10091)
This commit is contained in:
@@ -16,6 +16,33 @@ by the regionaliser, as it is not guaranteed that anything
|
|||||||
outside of the buffer zone is owned. Then, the plugins may use
|
outside of the buffer zone is owned. Then, the plugins may use
|
||||||
the schedulers depending on the result of the ownership check.
|
the schedulers depending on the result of the ownership check.
|
||||||
|
|
||||||
|
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
|
||||||
|
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
|
||||||
|
@@ -0,0 +0,0 @@ class PaperPluginInstanceManager {
|
||||||
|
+ pluginName + " (Is it up to date?)", ex, plugin); // Paper
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Paper start - Folia schedulers
|
||||||
|
+ try {
|
||||||
|
+ this.server.getGlobalRegionScheduler().cancelTasks(plugin);
|
||||||
|
+ } catch (Throwable ex) {
|
||||||
|
+ this.handlePluginException("Error occurred (in the plugin loader) while cancelling global tasks for "
|
||||||
|
+ + pluginName + " (Is it up to date?)", ex, plugin); // Paper
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ try {
|
||||||
|
+ this.server.getAsyncScheduler().cancelTasks(plugin);
|
||||||
|
+ } catch (Throwable ex) {
|
||||||
|
+ this.handlePluginException("Error occurred (in the plugin loader) while cancelling async tasks for "
|
||||||
|
+ + pluginName + " (Is it up to date?)", ex, plugin); // Paper
|
||||||
|
+ }
|
||||||
|
+ // Paper end - Folia schedulers
|
||||||
|
+
|
||||||
|
try {
|
||||||
|
this.server.getServicesManager().unregisterAll(plugin);
|
||||||
|
} catch (Throwable ex) {
|
||||||
diff --git a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
|
diff --git a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||||
|
Reference in New Issue
Block a user