1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-01-18 23:23:19 +01:00

Fix wolves ignoring result of damage event ()

This commit is contained in:
Warrior 2025-01-08 21:46:58 +01:00 committed by GitHub
parent 49d15f6345
commit b34ae4fb3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,7 +19,7 @@
+ public boolean actuallyHurt(ServerLevel level, DamageSource damageSource, float amount, org.bukkit.event.entity.EntityDamageEvent event) { // CraftBukkit - void -> boolean
if (!this.canArmorAbsorb(damageSource)) {
- super.actuallyHurt(level, damageSource, amount);
+ super.actuallyHurt(level, damageSource, amount, event); // CraftBukkit
+ return super.actuallyHurt(level, damageSource, amount, event); // CraftBukkit
} else {
+ if (event.isCancelled()) return false; // CraftBukkit - SPIGOT-7815: if the damage was cancelled, no need to run the wolf armor behaviour
ItemStack bodyArmorItem = this.getBodyArmorItem();