Paper/Spigot-API-Patches/0005-Add-getTPS-method.patch

47 lines
1.3 KiB
Diff
Raw Normal View History

2016-11-21 22:51:27 +01:00
From 4af32b49e181ea1b8eff460f6d5906e3415d0a4b Mon Sep 17 00:00:00 2001
2016-03-01 00:09:49 +01:00
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
2016-11-21 22:51:27 +01:00
index 07530ff..ed646ca 100644
2016-03-01 00:09:49 +01:00
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
2016-11-21 22:51:27 +01:00
@@ -1133,6 +1133,14 @@ public final class Bukkit {
2016-03-01 00:09:49 +01:00
}
/**
+ * 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
2016-11-21 22:51:27 +01:00
index 36d0be2..09f921a 100644
2016-03-01 00:09:49 +01:00
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
2016-11-21 22:51:27 +01:00
@@ -927,6 +927,13 @@ public interface Server extends PluginMessageRecipient {
2016-03-01 00:09:49 +01:00
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
*/
--
2016-11-17 03:23:38 +01:00
2.10.2
2016-03-01 00:09:49 +01:00