From 677651f909f529f023536227757177d52568ae5b Mon Sep 17 00:00:00 2001
From: Phillip Glanz
Date: Sun, 2 Apr 2023 23:25:22 +0200
Subject: [PATCH] Fix UnsupportedOperationException on disable
---
.../java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java
index e881416c5..c97cdc32d 100644
--- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java
+++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java
@@ -21,6 +21,7 @@ package com.sk89q.worldedit.bukkit;
import com.fastasyncworldedit.bukkit.BukkitPermissionAttachmentManager;
import com.fastasyncworldedit.bukkit.FaweBukkit;
+import com.fastasyncworldedit.core.util.FoliaSupport;
import com.fastasyncworldedit.core.util.UpdateNotification;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.util.WEManager;
@@ -400,7 +401,9 @@ public class WorldEditPlugin extends JavaPlugin {
if (config != null) {
config.unload();
}
- this.getServer().getScheduler().cancelTasks(this);
+ if (!FoliaSupport.isFolia()) {
+ this.getServer().getScheduler().cancelTasks(this);
+ }
}
/**