13
0
geforkt von Mirrors/Paper
Paper/Spigot-API-Patches/0005-Add-getTPS-method.patch

51 Zeilen
1.4 KiB
Diff

2017-01-06 22:45:59 +01:00
From 89cb7c72eef5269f43decc17a24bc748f00c8616 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
2017-01-06 22:45:59 +01:00
index 7fd544e..3b16953 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
2017-01-06 22:45:59 +01:00
@@ -1142,6 +1142,16 @@ public final class Bukkit {
return server.getEntity(uuid);
2016-03-01 00:09:49 +01:00
}
2017-01-06 22:45:59 +01:00
+ // Paper start
+ /**
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();
+ }
2017-01-06 22:45:59 +01:00
+ // Paper end
2016-03-01 00:09:49 +01:00
+
2017-01-06 22:45:59 +01:00
/**
2016-03-01 00:09:49 +01:00
* @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
2017-01-06 22:45:59 +01:00
index 77cfe56..a4e6894 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
2017-01-06 22:45:59 +01:00
@@ -934,6 +934,15 @@ public interface Server extends PluginMessageRecipient {
*/
Entity getEntity(UUID uuid);
2016-03-01 00:09:49 +01:00
2017-01-06 22:45:59 +01:00
+ // Paper start
+ /**
2016-03-01 00:09:49 +01:00
+ * Gets the current server TPS
+ *
+ * @return current server TPS (1m, 5m, 15m in Paper-Server)
+ */
+ public double[] getTPS();
2017-01-06 22:45:59 +01:00
+ // Paper end
2016-03-01 00:09:49 +01:00
+
2017-01-06 22:45:59 +01:00
/**
2016-03-01 00:09:49 +01:00
* @see UnsafeValues
* @return the unsafe values instance
--
2017-01-06 22:45:59 +01:00
2.9.3
2016-03-01 00:09:49 +01:00