diff options
Diffstat (limited to 'patches/server/0244-Expose-attack-cooldown-methods-for-Player.patch')
-rw-r--r-- | patches/server/0244-Expose-attack-cooldown-methods-for-Player.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/patches/server/0244-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0244-Expose-attack-cooldown-methods-for-Player.patch new file mode 100644 index 0000000000..f736e3418f --- /dev/null +++ b/patches/server/0244-Expose-attack-cooldown-methods-for-Player.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath <[email protected]> +Date: Tue, 4 Sep 2018 15:02:00 -0500 +Subject: [PATCH] Expose attack cooldown methods for Player + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index 59d19212487770304a9b273f1546a2cc199764ab..a787be4cc43a01c7a6d66fe507df2ab2b63019a0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -2953,6 +2953,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + + return this.adventure$pointers; + } ++ ++ @Override ++ public float getCooldownPeriod() { ++ return getHandle().getCurrentItemAttackStrengthDelay(); ++ } ++ ++ @Override ++ public float getCooledAttackStrength(float adjustTicks) { ++ return getHandle().getAttackStrengthScale(adjustTicks); ++ } ++ ++ @Override ++ public void resetCooldown() { ++ getHandle().resetAttackStrengthTicker(); ++ } + // Paper end + // Spigot start + private final Player.Spigot spigot = new Player.Spigot() |