PaperMC/patches/api/0499-API-to-allow-disallow-tick-sleeping.patch
Spottedleaf 4190ee7439 Add Server#isGlobalTickThread
This method should be present in Paper, not just in Folia, given
that the GlobalRegionScheduler is present.

Additonally, add Server#isOwnedByCurrentRegion(World, int, int, int, int)
for checking of a rectangle of chunks is owned by the current region.
2024-11-25 10:43:28 -08:00

25 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Abel <abelvanhulst@gmail.com>
Date: Tue, 12 Nov 2024 22:25:35 +0100
Subject: [PATCH] API to allow/disallow tick sleeping
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 7266d29ab6bb246e6daaa643951417123d42abcb..a92bd4da6788f1331a4838ab5760baec2dc6e8ec 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2597,5 +2597,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* Returns whether the server is sleeping/paused.
*/
boolean isPaused();
+
+ /**
+ * Allows or disallows the server to sleep/pause.
+ * If any plugin disallows pausing, the server will never pause.
+ *
+ * @param plugin The {@link org.bukkit.plugin.Plugin} that's allowing or disallowing pausing.
+ * @param value Whether to allow sleeping of the server (defaults to true).
+ */
+ void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value);
// Paper end - API to check if the server is sleeping
}