We're going on an Adventure! (#4842)
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: zml <zml@stellardrift.ca> Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
This commit is contained in:
parent
1a97356116
commit
4e958e229f
948 changed files with 7844 additions and 1589 deletions
|
@ -1,62 +0,0 @@
|
|||
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 683c9dc0f183cdee8dd909835c0cb0fe9b033075..2d73a06dc6b6a5163696750cb563d52e327ab4d1 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1464,6 +1464,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 af9f834f468cefbb72f798d63b9eb7b10811ed9f..a15e672be066cef7828a8e0c5b09209d8c268181 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1232,6 +1232,21 @@ public interface Server extends PluginMessageRecipient {
|
||||
*/
|
||||
@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