9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-19 14:59:25 +00:00
Files
DivineMC/divinemc-api/paper-patches/features/0010-SparklyPaper-Parallel-world-ticking.patch
2025-10-29 01:42:19 +03:00

60 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Tue, 28 Oct 2025 16:26:54 +0300
Subject: [PATCH] SparklyPaper: Parallel world ticking
Original license: MIT
Original project (API): https://github.com/Biquaternions/Fish
Original project: https://github.com/SparklyPower/SparklyPaper
This patch provides an API for performance monitoring plugins.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index bf664ec7a3974abdb7fd3266b08803a02cb05929..d21f2c33480177f4892c906b80ffe89686ac663a 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2879,4 +2879,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
void clearBlockHighlights();
// Purpur end - Debug Marker API
+
+ // DivineMC start - Parallel world ticking
+ /**
+ * Returns whether the software has the Parallel World Ticking feature enabled
+ *
+ * @return If the Parallel World Ticking feature is enabled
+ */
+ public default boolean isParallelWorldTickingEnabled() {
+ return false;
+ }
+ // DivineMC end - Parallel world ticking
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index d320e8b621a8725d07579fbc3182df9b4822e3fb..6128b98305ee0c843df4bfef13fcb2f6a809d416 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4722,4 +4722,23 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
}
}
+
+ // DivineMC start - Parallel world ticking
+ /**
+ * Get a sample of the world last tick times (in nanos)
+ *
+ * @return A sample of the world last tick times (in nanos)
+ */
+ public default long @NotNull [] getTickTimes() {
+ return new long[0];
+ }
+ /**
+ * Get the world's average tick time (in millis)
+ *
+ * @return World's local average tick time (in millis)
+ */
+ public default double getAverageTickTime () {
+ return 0.0;
+ }
+ // DivineMC end - Parallel world ticking
}