Expose server build information (#10729)
* Expose server build information * squash patches * final tweaks --------- Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: masmc05 <masmc05@gmail.com>
This commit is contained in:
parent
3fc93581bb
commit
f17519338b
1360 changed files with 1817 additions and 1446 deletions
62
patches/api/0185-Add-tick-times-API.patch
Normal file
62
patches/api/0185-Add-tick-times-API.patch
Normal file
|
@ -0,0 +1,62 @@
|
|||
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 836b5d1363ffcff08708b6b4721253ade99eb987..1a8f4e122b84b423fe19bfafad56d6d3df9ec134 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2179,6 +2179,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 387478b3e4ad9877f3338b719ff447126ef16285..fc4e259e5ca7a4b25f276bda7f2f5ea022d0c552 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1846,6 +1846,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
|
Loading…
Add table
Add a link
Reference in a new issue