From 5726caded8bf23e55b72db3fccb9499039839caa Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Sat, 20 Apr 2019 19:47:50 -0500 Subject: [PATCH] Expose the internal current tick --- .../Expose-the-internal-current-tick.patch | 39 +++++++++++++++++++ .../Expose-the-internal-current-tick.patch | 22 +++++++++++ 2 files changed, 61 insertions(+) create mode 100644 Spigot-API-Patches/Expose-the-internal-current-tick.patch create mode 100644 Spigot-Server-Patches/Expose-the-internal-current-tick.patch diff --git a/Spigot-API-Patches/Expose-the-internal-current-tick.patch b/Spigot-API-Patches/Expose-the-internal-current-tick.patch new file mode 100644 index 0000000000..e001c02ebd --- /dev/null +++ b/Spigot-API-Patches/Expose-the-internal-current-tick.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath +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 6db69159..231bc6e3 100644 +--- a/src/main/java/org/bukkit/Bukkit.java ++++ b/src/main/java/org/bukkit/Bukkit.java +@@ -0,0 +0,0 @@ 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 27d3b5ad..31470479 100644 +--- a/src/main/java/org/bukkit/Server.java ++++ b/src/main/java/org/bukkit/Server.java +@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { + */ + @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 + } +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Expose-the-internal-current-tick.patch b/Spigot-Server-Patches/Expose-the-internal-current-tick.patch new file mode 100644 index 0000000000..40b63f62d9 --- /dev/null +++ b/Spigot-Server-Patches/Expose-the-internal-current-tick.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath +Date: Sat, 20 Apr 2019 19:47:34 -0500 +Subject: [PATCH] Expose the internal current tick + + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index 7a8ab7d40..105d31906 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -0,0 +0,0 @@ public final class CraftServer implements Server { + } + return new com.destroystokyo.paper.profile.CraftPlayerProfile(uuid, name); + } ++ ++ @Override ++ public int getCurrentTick() { ++ return net.minecraft.server.MinecraftServer.currentTick; ++ } + // Paper end + } +-- \ No newline at end of file