Yatopia/patches/api/0032-Add-getLastTickMs-api.patch

53 lines
1.4 KiB
Diff
Raw Normal View History

2020-03-22 16:40:40 +01:00
From 60a34cc1a5fa232371cc3f2c6c4f530909e7c70b Mon Sep 17 00:00:00 2001
2020-03-05 21:14:17 +01:00
From: tr7zw <tr7zw@live.de>
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
2020-03-21 17:29:35 +01:00
index b9973406..610bd5b1 100644
2020-03-05 21:14:17 +01:00
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
2020-03-21 17:29:35 +01:00
@@ -1662,6 +1662,14 @@ public final class Bukkit {
2020-03-05 21:14:17 +01:00
return server.getCurrentTick();
}
// 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
2020-03-22 16:40:40 +01:00
index 55ec8d2d..ba7ef28b 100644
2020-03-05 21:14:17 +01:00
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
2020-03-22 16:40:40 +01:00
@@ -1464,4 +1464,15 @@ public interface Server extends PluginMessageRecipient {
2020-03-05 21:14:17 +01:00
*/
int getCurrentTick();
// Paper end
+
+ // YAPFA start
+
+ /**
+ * Get the ms the last servertick took
+ *
+ * @return Last ticks ms
+ */
+ long getLastTickMs();
+
+ // YAPFA end
}
--
2.25.1.windows.1