2021-06-11 14:02:28 +02: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
|
2024-04-25 22:47:32 +02:00
|
|
|
index f161f564a682bf7c5fc9f3ffa0df8fcaa7c2d86c..8e294b2583b7a26c463d6f12d3c42c0da83741f8 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2024-04-25 07:29:18 +02:00
|
|
|
@@ -2961,6 +2961,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2021-09-23 23:07:44 +02:00
|
|
|
|
|
|
|
return this.adventure$pointers;
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
+
|
2021-06-13 06:03:02 +02:00
|
|
|
+ @Override
|
2021-06-11 14:02:28 +02:00
|
|
|
+ public float getCooldownPeriod() {
|
2021-06-13 06:03:02 +02:00
|
|
|
+ return getHandle().getCurrentItemAttackStrengthDelay();
|
2021-06-11 14:02:28 +02:00
|
|
|
+ }
|
|
|
|
+
|
2021-06-13 06:03:02 +02:00
|
|
|
+ @Override
|
2021-06-11 14:02:28 +02:00
|
|
|
+ public float getCooledAttackStrength(float adjustTicks) {
|
|
|
|
+ return getHandle().getAttackStrengthScale(adjustTicks);
|
|
|
|
+ }
|
|
|
|
+
|
2021-06-13 06:03:02 +02:00
|
|
|
+ @Override
|
2021-06-11 14:02:28 +02:00
|
|
|
+ public void resetCooldown() {
|
|
|
|
+ getHandle().resetAttackStrengthTicker();
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
// Spigot start
|
2021-11-23 22:40:37 +01:00
|
|
|
private final Player.Spigot spigot = new Player.Spigot()
|