3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-17 13:30:06 +01:00
Paper/Spigot-API-Patches/0005-Add-getTPS-method.patch

47 Zeilen
1.3 KiB
Diff

2016-07-31 01:02:34 +02:00
From 5c2caa3ee27bbd84914df4a001cfb7bcb528b3a2 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-03-25 05:59:37 +01:00
index 85fd9a8..8d602a3 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-03-25 05:59:37 +01:00
@@ -1140,6 +1140,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-03-25 05:59:37 +01:00
index f82cbaf..6e23b0c 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
@@ -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
*/
--
2016-07-31 01:02:34 +02:00
2.9.2.windows.1
2016-03-01 00:09:49 +01:00