- if (!this.actuallyHurt(source, (float) event.getFinalDamage() - this.lastHurt, event)) {
+ final float actualDamage = (float) event.getFinalDamage() - this.lastHurt; // Paper - revert to vanilla damage - move out for diff on change
+ if (!this.actuallyHurt(source, actualDamage, event)) { // Paper - revert to vanilla damage - move out for diff on change
return false;
}
+ if (this instanceof ServerPlayer && actualDamage == 0.0F) return false; // Paper - revert to vanilla damage - players are not affected by damage that is 0.
// CraftBukkit end
this.lastHurt = amount;
flag1 = false;
@@ -1487,6 +1489,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (!this.actuallyHurt(source, (float) event.getFinalDamage(), event)) {
return false;
}
+ if (this instanceof ServerPlayer && event.getFinalDamage() == 0.0F) return false; // Paper - revert to vanilla damage - players are not affected by damage that is 0.
this.lastHurt = amount;
this.invulnerableTime = this.invulnerableDuration; // CraftBukkit - restore use of maxNoDamageTicks
// this.actuallyHurt(damagesource, f);
@@ -2411,12 +2414,12 @@ public abstract class LivingEntity extends Entity implements Attackable {