Paper/patches/api/0186-Expose-the-internal-current-tick.patch

39 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 20 Apr 2019 19:47:29 -0500
Subject: [PATCH] Expose the internal current tick
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 91100e2acf40a8944190a79da2d5bf06799cd4b6..663d8e27ba6625a20201a9abc66371dc71eeee42 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1957,6 +1957,10 @@ public final class Bukkit {
public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name) {
return server.createProfile(uuid, name);
}
+
+ public static int getCurrentTick() {
+ return server.getCurrentTick();
+ }
// Paper end
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index c165a4e3d68c8a62316a8e295c23d2c28c56cae8..339bcb8d47c3d9856cf5fbc87ba3a104f414c462 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1718,5 +1718,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
@NotNull
com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name);
+
+ /**
+ * Get the current internal server tick
+ *
+ * @return Current tick
+ */
+ int getCurrentTick();
// Paper end
}