Fix wolves ignoring result of damage event (#11932)

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();