mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Fix Folia scheduler tasks not canceling when plugin disable (#10091)
This commit is contained in:
parent
0c4e87fd28
commit
09ae4f6257
1 changed files with 27 additions and 0 deletions
|
@ -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
|
||||
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
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
|
|
Loading…
Reference in a new issue