diff options
Diffstat (limited to 'patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch')
-rw-r--r-- | patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch b/patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch index 90c43e9e4d..be9e57b2e3 100644 --- a/patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch +++ b/patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch @@ -5,15 +5,16 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 24ec68cecd11b8faa8bff11989b64985c26707cc..045cfadc67c597f4607ed3ba6a5c9b06e95814ba 100644 +index 57528fce99102da6b3d0c3d9dbf9d2cd71375ff8..f2e66b50b32d197f9a8d4a9672ebf1413e66d59b 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2248,7 +2248,16 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2277,7 +2277,17 @@ public abstract class LivingEntity extends Entity implements Attackable { + } - EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption); if (damagesource.getEntity() instanceof net.minecraft.world.entity.player.Player) { - ((net.minecraft.world.entity.player.Player) damagesource.getEntity()).resetAttackStrengthTicker(); // Moved from EntityHuman in order to make the cooldown reset get called after the damage event is fired + // Paper start - PlayerAttackEntityCooldownResetEvent ++ //((net.minecraft.world.entity.player.Player) damagesource.getEntity()).resetAttackStrengthTicker(); // Moved from EntityHuman in order to make the cooldown reset get called after the damage event is fired + if (damagesource.getEntity() instanceof ServerPlayer) { + ServerPlayer player = (ServerPlayer) damagesource.getEntity(); + if (new com.destroystokyo.paper.event.player.PlayerAttackEntityCooldownResetEvent(player.getBukkitEntity(), this.getBukkitEntity(), player.getAttackStrengthScale(0F)).callEvent()) { @@ -24,5 +25,5 @@ index 24ec68cecd11b8faa8bff11989b64985c26707cc..045cfadc67c597f4607ed3ba6a5c9b06 + } + // Paper end - PlayerAttackEntityCooldownResetEvent } - if (event.isCancelled()) { - return false; + + // Resistance |