From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: BillyGalbreath 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 3bdb53c3a41da6d4d3a641f790741a3c79e1734a..3421f446849bd4feded248406bd4748416e4d9fa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2785,6 +2785,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()