diff options
author | William Blake Galbreath <[email protected]> | 2019-04-20 19:47:50 -0500 |
---|---|---|
committer | Shane Freeder <[email protected]> | 2019-10-30 17:42:53 +0000 |
commit | e38aa244d4a2b669aa5f7fb32fd71b2f3363631b (patch) | |
tree | 52a028f903e099343d03ff156a156a0dc908cf19 | |
parent | 26c863d3c235932abf006eff2772ad51c92859e2 (diff) | |
download | Paper-e38aa244d4a2b669aa5f7fb32fd71b2f3363631b.tar.gz Paper-e38aa244d4a2b669aa5f7fb32fd71b2f3363631b.zip |
Expose the internal current tick
-rw-r--r-- | Spigot-API-Patches/0185-Expose-the-internal-current-tick.patch | 41 | ||||
-rw-r--r-- | Spigot-Server-Patches/0446-Expose-the-internal-current-tick.patch | 24 |
2 files changed, 65 insertions, 0 deletions
diff --git a/Spigot-API-Patches/0185-Expose-the-internal-current-tick.patch b/Spigot-API-Patches/0185-Expose-the-internal-current-tick.patch new file mode 100644 index 0000000000..c7659364c1 --- /dev/null +++ b/Spigot-API-Patches/0185-Expose-the-internal-current-tick.patch @@ -0,0 +1,41 @@ +From 02ea1aa9dda3125c29a1bcdfb5b5a3c76e4d2f6b Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath <[email protected]> +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 ca88f0a3..4b0c0dcb 100644 +--- a/src/main/java/org/bukkit/Bukkit.java ++++ b/src/main/java/org/bukkit/Bukkit.java +@@ -1629,6 +1629,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 697ff748..6be7e399 100644 +--- a/src/main/java/org/bukkit/Server.java ++++ b/src/main/java/org/bukkit/Server.java +@@ -1424,5 +1424,12 @@ 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 + } +-- +2.23.0 + diff --git a/Spigot-Server-Patches/0446-Expose-the-internal-current-tick.patch b/Spigot-Server-Patches/0446-Expose-the-internal-current-tick.patch new file mode 100644 index 0000000000..3f07ee0a7f --- /dev/null +++ b/Spigot-Server-Patches/0446-Expose-the-internal-current-tick.patch @@ -0,0 +1,24 @@ +From 1837cd5f7e2f61940b3cc9d60b572eaf7fa98dcd Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath <[email protected]> +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 9fb6c0990..c92b508db 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -2214,5 +2214,10 @@ public final class CraftServer implements Server { + } + return new com.destroystokyo.paper.profile.CraftPlayerProfile(uuid, name); + } ++ ++ @Override ++ public int getCurrentTick() { ++ return MinecraftServer.currentTick; ++ } + // Paper end + } +-- +2.23.0 + |