Folia/patches/api/0002-Region-scheduler-API.patch

45 lines
2.3 KiB
Diff
Raw Normal View History

2023-03-04 22:13:23 +01:00
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.
2023-03-04 22:13:23 +01:00
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
2024-06-19 23:42:39 +02:00
index 003bece642b682985625db93cad93026352bfc66..065352b383d6398382b4f14641859dbfe2e6a355 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
2024-06-19 23:42:39 +02:00
@@ -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
}
2023-03-26 00:29:07 +01:00
diff --git a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java
index 487b5ca23159b531475c3d650894be707b49914e..31b90d1c2259a8f200b0589909dbbfe4cc526989 100644
2023-03-26 00:29:07 +01:00
--- 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 {
/**