Paper/Spigot-API-Patches/0005-Add-getTPS-method.patch
Zach Brown 63130fd2aa
Update upstream B/CB
Closes GH-569
2017-01-06 15:45:59 -06:00

51 lines
1.4 KiB
Diff

From 89cb7c72eef5269f43decc17a24bc748f00c8616 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 7fd544e..3b16953 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1142,6 +1142,16 @@ public final class Bukkit {
return server.getEntity(uuid);
}
+ // Paper start
+ /**
+ * Gets the current server TPS
+ * @return current server TPS (1m, 5m, 15m in Paper-Server)
+ */
+ public static double[] getTPS() {
+ return server.getTPS();
+ }
+ // Paper end
+
/**
* @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 77cfe56..a4e6894 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -934,6 +934,15 @@ public interface Server extends PluginMessageRecipient {
*/
Entity getEntity(UUID uuid);
+ // Paper start
+ /**
+ * Gets the current server TPS
+ *
+ * @return current server TPS (1m, 5m, 15m in Paper-Server)
+ */
+ public double[] getTPS();
+ // Paper end
+
/**
* @see UnsafeValues
* @return the unsafe values instance
--
2.9.3