2021-06-11 12:02:28 +00:00
|
|
|
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
|
2022-10-02 07:56:36 +00:00
|
|
|
index 58a1e433b0bd7c093c964a9dfcbb7287b5988af4..cea4285095979f0656821e897659c7b91d237e82 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2022-09-26 08:02:51 +00:00
|
|
|
@@ -2589,6 +2589,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2021-09-23 21:07:44 +00:00
|
|
|
|
|
|
|
return this.adventure$pointers;
|
2021-06-11 12:02:28 +00:00
|
|
|
}
|
|
|
|
+
|
2021-06-13 04:03:02 +00:00
|
|
|
+ @Override
|
2021-06-11 12:02:28 +00:00
|
|
|
+ public float getCooldownPeriod() {
|
2021-06-13 04:03:02 +00:00
|
|
|
+ return getHandle().getCurrentItemAttackStrengthDelay();
|
2021-06-11 12:02:28 +00:00
|
|
|
+ }
|
|
|
|
+
|
2021-06-13 04:03:02 +00:00
|
|
|
+ @Override
|
2021-06-11 12:02:28 +00:00
|
|
|
+ public float getCooledAttackStrength(float adjustTicks) {
|
|
|
|
+ return getHandle().getAttackStrengthScale(adjustTicks);
|
|
|
|
+ }
|
|
|
|
+
|
2021-06-13 04:03:02 +00:00
|
|
|
+ @Override
|
2021-06-11 12:02:28 +00:00
|
|
|
+ public void resetCooldown() {
|
|
|
|
+ getHandle().resetAttackStrengthTicker();
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
// Spigot start
|
2021-11-23 21:40:37 +00:00
|
|
|
private final Player.Spigot spigot = new Player.Spigot()
|