mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 10:35:38 +01:00
6483ecb8a2
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: a6aba46f PR-1078: Improve Javadocs of Player#loadData() and Player#saveData() 1e2e6a18 SPIGOT-7946: API for server pause when empty seconds 54a36938 SPIGOT-7944, PR-1077: Allow nullable fields in DamageTypeTags CraftBukkit Changes: 2702c5c8e SPIGOT-7946: API for server pause when empty seconds 485f910fc SPIGOT-7947: addPassenger doesn't work if the vehicle is a player ecf3dff0e SPIGOT-7949: Registering a new scoreboard objective with an empty display name throws a NPE 9b048cc84 SPIGOT-7948: `Bukkit#dispatchCommand` uses the wrong `CommandListenerWrapper` for Players 7b44d4640 SPIGOT-7931: Fix sync in Anvil View when result item is taken
63 lines
1.9 KiB
Diff
63 lines
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Sun, 5 Apr 2020 22:22:58 -0500
|
|
Subject: [PATCH] Add tick times API
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
|
index 7e4673f672233d69df4bf53244542daa7fdcac75..57a9b5433ffb22017e24c9be4a2eeaa2f439bea8 100644
|
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
|
@@ -2218,6 +2218,25 @@ public final class Bukkit {
|
|
public static double[] getTPS() {
|
|
return server.getTPS();
|
|
}
|
|
+
|
|
+ /**
|
|
+ * Get a sample of the servers last tick times (in nanos)
|
|
+ *
|
|
+ * @return A sample of the servers last tick times (in nanos)
|
|
+ */
|
|
+ @NotNull
|
|
+ public static long[] getTickTimes() {
|
|
+ return server.getTickTimes();
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Get the average tick time (in millis)
|
|
+ *
|
|
+ * @return Average tick time (in millis)
|
|
+ */
|
|
+ public static double getAverageTickTime() {
|
|
+ return server == null ? 0D : server.getAverageTickTime();
|
|
+ }
|
|
// Paper end
|
|
|
|
/**
|
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
|
index df37ce5da240ead6841e72ebdfddf2cd55caa27b..940f36835b541931ece973636c2e07e1a3c0db5b 100644
|
|
--- a/src/main/java/org/bukkit/Server.java
|
|
+++ b/src/main/java/org/bukkit/Server.java
|
|
@@ -1877,6 +1877,21 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
|
*/
|
|
@NotNull
|
|
public double[] getTPS();
|
|
+
|
|
+ /**
|
|
+ * Get a sample of the servers last tick times (in nanos)
|
|
+ *
|
|
+ * @return A sample of the servers last tick times (in nanos)
|
|
+ */
|
|
+ @NotNull
|
|
+ long[] getTickTimes();
|
|
+
|
|
+ /**
|
|
+ * Get the average tick time (in millis)
|
|
+ *
|
|
+ * @return Average tick time (in millis)
|
|
+ */
|
|
+ double getAverageTickTime();
|
|
// Paper end
|
|
|
|
// Paper start
|