mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-21 00:17:56 +01:00
47 lines
1.3 KiB
Diff
47 lines
1.3 KiB
Diff
From 9082960948db00f8186644598d78836679ac08cf Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Mon, 29 Feb 2016 17:24:57 -0600
|
|
Subject: [PATCH] Add getTPS method
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
|
index dc2c9d1..e19f3d7 100644
|
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
|
@@ -1141,6 +1141,14 @@ public final class Bukkit {
|
|
}
|
|
|
|
/**
|
|
+ * Gets the current server TPS
|
|
+ * @return current server TPS (1m, 5m, 15m in Paper-Server)
|
|
+ */
|
|
+ public static double[] getTPS() {
|
|
+ return server.getTPS();
|
|
+ }
|
|
+
|
|
+ /**
|
|
* @see UnsafeValues
|
|
* @return the unsafe values instance
|
|
*/
|
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
|
index 69720e9..92a5cbc 100644
|
|
--- a/src/main/java/org/bukkit/Server.java
|
|
+++ b/src/main/java/org/bukkit/Server.java
|
|
@@ -934,6 +934,13 @@ public interface Server extends PluginMessageRecipient {
|
|
BossBar createBossBar(String title, BarColor color, BarStyle style, BarFlag ...flags);
|
|
|
|
/**
|
|
+ * Gets the current server TPS
|
|
+ *
|
|
+ * @return current server TPS (1m, 5m, 15m in Paper-Server)
|
|
+ */
|
|
+ public double[] getTPS();
|
|
+
|
|
+ /**
|
|
* @see UnsafeValues
|
|
* @return the unsafe values instance
|
|
*/
|
|
--
|
|
2.7.2
|
|
|