mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 21:47:55 +01:00
33 lines
1.2 KiB
Diff
33 lines
1.2 KiB
Diff
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 ad75996926b7e054f1053d07fb978ac745f22ce6..535e0438b02fd7c10aee0d24786a6e38c6e48359 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -2993,6 +2993,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()
|