mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-04 15:41:40 +00:00
Update changes from ver/1.21.4 branch
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||
Date: Wed, 30 Nov 2022 12:57:37 +0100
|
||||
Subject: [PATCH] Specific interval TPS API
|
||||
|
||||
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index c9ea6559f809a6732588b8908001807be3d91196..1e810d7f61e07cddd99d3f827673b724ac93b6b5 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2438,6 +2438,35 @@ public final class Bukkit {
|
||||
return server.getTPS();
|
||||
}
|
||||
|
||||
+ // Gale start - specific interval TPS API
|
||||
+ /**
|
||||
+ * Gets the average server TPS over the last 1 minute
|
||||
+ *
|
||||
+ * @return the average server TPS over the last 1 minute
|
||||
+ */
|
||||
+ public static double get1MinuteTPSAverage() {
|
||||
+ return server.get1MinuteTPSAverage();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the average server TPS over the last 5 minutes
|
||||
+ *
|
||||
+ * @return the average server TPS over the last 5 minutes
|
||||
+ */
|
||||
+ public static double get5MinuteTPSAverage() {
|
||||
+ return server.get5MinuteTPSAverage();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the average server TPS over the last 15 minutes
|
||||
+ *
|
||||
+ * @return the average server TPS over the last 15 minutes
|
||||
+ */
|
||||
+ public static double get15MinuteTPSAverage() {
|
||||
+ return server.get15MinuteTPSAverage();
|
||||
+ }
|
||||
+ // Gale end - specific interval TPS API
|
||||
+
|
||||
/**
|
||||
* Get a sample of the servers last tick times (in nanos)
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index c1e4f01dbec2a796025ef35b6fdd68a82fa319d1..cfe600ed503994376284d71d6754d1a736048401 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2126,6 +2126,29 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
public double @NotNull [] getTPS();
|
||||
|
||||
+ // Gale start - specific interval TPS API
|
||||
+ /**
|
||||
+ * Gets the average server TPS over the last 1 minute
|
||||
+ *
|
||||
+ * @return the average server TPS over the last 1 minute
|
||||
+ */
|
||||
+ double get1MinuteTPSAverage();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the average server TPS over the last 5 minutes
|
||||
+ *
|
||||
+ * @return the average server TPS over the last 5 minutes
|
||||
+ */
|
||||
+ double get5MinuteTPSAverage();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the average server TPS over the last 15 minutes
|
||||
+ *
|
||||
+ * @return the average server TPS over the last 15 minutes
|
||||
+ */
|
||||
+ double get15MinuteTPSAverage();
|
||||
+ // Gale end - specific interval TPS API
|
||||
+
|
||||
/**
|
||||
* Get a sample of the servers last tick times (in nanos)
|
||||
*
|
||||
Reference in New Issue
Block a user