Paper/patches/server/0255-Expose-attack-cooldown-methods-for-Player.patch
Jake Potrebic aabbfcdf8d
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
4b08dbc5 PR-752: Make Leaves Waterlogged
de323fc9 Downgrade dependency version

CraftBukkit Changes:
c3f219edb Fix missing abstract in CraftLeaves
886e6d8c8 SPIGOT-7038: Setting title or subtitle to empty string causes the player to disconnect
6c302a5e3 Make Leaves Waterlogged
53b681be5 Downgrade dependency version

Spigot Changes:
ee737122 Fixed system messages shown in action bar
f343df82 SPIGOT-7036: Don't use CHAT message type
63a06049 SPIGOT-7035: Actionbar Sending in Main Chat
2022-06-08 00:49:02 -07:00

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 47abdbaa2663efb4817396d49389f7f3719c5f74..60b016aed7c70385abb14b2b2266fc70adf788a6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2505,6 +2505,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()