Yatopia/patches/api/0005-Add-getLastTickMs-api.patch
2020-09-13 10:00:43 +03: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 8d172d58b7c935f608ac49d3376d5b90bdf0abdd..808574e7d40346fd0b923b14b534730cbfd10aae 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1798,4 +1798,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 d92d19a689c5dd928095c082a7c96680e97c6e6a..6783cb1650dae96b61de2a0e9b90854d0b05ad0a 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1625,4 +1625,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
}