Yatopia/patches/api/0005-Add-getLastTickMs-api.patch
2020-08-06 19:18:29 +02:00

40 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Sat, 1 Aug 2020 15:54:43 -0500
Subject: [PATCH] Add getLastTickMs api
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 0770736b4b52f325027671b43f74ad038c97ce7f..537e7fc9273b7e4ecc88eaad5b1a69d3864740d0 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1787,4 +1787,10 @@ public final class Bukkit {
return server.isLagging();
}
// Purpur end
+
+ // Yatopia start
+ public static long getLastTickMs() {
+ return server.getLastTickMs();
+ }
+ // Yatopia end
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 154c24a5a32450636b1c554df1bb5262fa05e9c8..1eb935b3ba88918f04a075d47b0f514ddc8f2499 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1599,4 +1599,13 @@ public interface Server extends PluginMessageRecipient {
*/
boolean isLagging();
// Purpur end
+
+ // Yatopia start
+ /**
+ * Get the ms the last servertick took
+ *
+ * @return Last ticks ms
+ */
+ long getLastTickMs();
+ // Yatopia end
}