From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sat, 4 Mar 2023 12:48:43 -0800
Subject: [PATCH] Region scheduler API

Add both a location based scheduler, an entity based scheduler,
and a global region scheduler.

diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 001465eedafa51ac027a4db51cba6223edfe1171..468f5646da7bc413a6e91e82379e6554cc8b459d 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -557,9 +557,9 @@ public final class SimplePluginManager implements PluginManager {
             }
 
             try {
-                server.getScheduler().cancelTasks(plugin);
+                server.getAsyncScheduler().cancelTasks(plugin); // Folia - new schedulers
             } catch (Throwable ex) {
-                handlePluginException("Error occurred (in the plugin loader) while cancelling tasks for "
+                handlePluginException("Error occurred (in the plugin loader) while cancelling async tasks for " // Folia - new schedulers
                         + plugin.getDescription().getFullName() + " (Is it up to date?)", ex, plugin); // Paper
             }
 
diff --git a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java
index 5c277ac7a61df8106f7c13a1ad8ccb1509338699..446c115f19c4dde0d5e269f8d120bc51ad3898e0 100644
--- a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java
+++ b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java
@@ -7,6 +7,15 @@ import java.util.function.Consumer;
 import org.bukkit.plugin.Plugin;
 import org.jetbrains.annotations.NotNull;
 
+// Folia start - add new schedulers
+/**
+ * @deprecated Use one of {@link io.papermc.paper.threadedregions.scheduler.RegionScheduler},
+ *                        {@link io.papermc.paper.threadedregions.scheduler.AsyncScheduler},
+ *                        {@link io.papermc.paper.threadedregions.scheduler.EntityScheduler},
+ *                        or {@link io.papermc.paper.threadedregions.scheduler.GlobalRegionScheduler}
+ */
+// Folia end - add new schedulers
+@Deprecated
 public interface BukkitScheduler {
 
     /**
