diff options
Diffstat (limited to 'Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch')
-rw-r--r-- | Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch b/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch index be16bad720..df5b38adac 100644 --- a/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch +++ b/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 574d9ef4f4f0e95a66252b0428ff84c72d5bc32c..ad92d6d30f0e3280c2e4cab6d0c96280d40ae2ef 100644 +index 574d9ef4f4f0e95a66252b0428ff84c72d5bc32c..ce823833a0b308aeb11902652157575eabf09e3b 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -1822,7 +1822,16 @@ public abstract class EntityLiving extends Entity { @@ -16,11 +16,11 @@ index 574d9ef4f4f0e95a66252b0428ff84c72d5bc32c..ad92d6d30f0e3280c2e4cab6d0c96280 + // Paper start - PlayerAttackEntityCooldownResetEvent + if (damagesource.getEntity() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) damagesource.getEntity(); -+ if (new com.destroystokyo.paper.event.player.PlayerAttackEntityCooldownResetEvent(player.getBukkitEntity(), this.getBukkitEntity(), player.getCooledAttackStrength(0F)).callEvent()) { -+ player.resetCooldown(); ++ if (new com.destroystokyo.paper.event.player.PlayerAttackEntityCooldownResetEvent(player.getBukkitEntity(), this.getBukkitEntity(), player.getAttackCooldown(0F)).callEvent()) { ++ player.resetAttackCooldown(); + } + } else { -+ ((EntityHuman) damagesource.getEntity()).resetCooldown(); ++ ((EntityHuman) damagesource.getEntity()).resetAttackCooldown(); + } + // Paper end } |