From 5b64d1ba79529221d1839ddbaf90ad7b965c1c7d Mon Sep 17 00:00:00 2001 From: tr7zw Date: Thu, 5 Mar 2020 21:13:14 +0100 Subject: [PATCH] Add getLastTickMs() api --- src/main/java/org/bukkit/Bukkit.java | 8 ++++++++ src/main/java/org/bukkit/Server.java | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index ea3e5d6fa..c963a5980 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -1690,6 +1690,14 @@ public final class Bukkit { return server.isStopping(); } // Paper end + + // YAPFA start + + public static long getLastTickMs() { + return server.getLastTickMs(); + } + + // YAPFA end @NotNull public static Server.Spigot spigot() { diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index c59c03be6..36740b4ef 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -1486,4 +1486,15 @@ public interface Server extends PluginMessageRecipient { */ boolean isStopping(); // Paper end + + // YAPFA start + + /** + * Get the ms the last servertick took + * + * @return Last ticks ms + */ + long getLastTickMs(); + + // YAPFA end } -- 2.25.1.windows.1