From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
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 d034c84a95f24233a8dd54b25c1ef670311c346a..80ae7a85cf4dbad3aa6a17c4095b9db193a0aec9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2850,6 +2850,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.adventure$pointers;
}
+
+ @Override
+ public float getCooldownPeriod() {
+ return getHandle().getCurrentItemAttackStrengthDelay();
+ }
+ public float getCooledAttackStrength(float adjustTicks) {
+ return getHandle().getAttackStrengthScale(adjustTicks);
+ public void resetCooldown() {
+ getHandle().resetAttackStrengthTicker();
// Paper end
// Spigot start
private final Player.Spigot spigot = new Player.Spigot()