diff options
Diffstat (limited to 'patches/unapplied/server/0239-Expose-attack-cooldown-methods-for-Player.patch')
-rw-r--r-- | patches/unapplied/server/0239-Expose-attack-cooldown-methods-for-Player.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/patches/unapplied/server/0239-Expose-attack-cooldown-methods-for-Player.patch b/patches/unapplied/server/0239-Expose-attack-cooldown-methods-for-Player.patch new file mode 100644 index 0000000000..1d6a1224bf --- /dev/null +++ b/patches/unapplied/server/0239-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 5239ce2d507f48effc4f3e2bc462d9caef5caa92..b9e325d32fabe77fe1ebd0d8b988db594b154284 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -2995,6 +2995,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() |