Properly apply damage tick after absorption (#11043)
The logic in place to prevent players from processing a damage tick/knockback/etc when hit with 0 damage incorrectly used the damage events final damage value, which is reduced by absorption. Instead, use the event's "raw damage", e.g. the amount passed to hurt, in order to determine if the damage tick should be skipped. This still allows plugins to change the damage to a non-zero value and properly damage ticks the player in such a case, but correctly processes the damage tick in cases where the original damage is non zero but the actual damage is.
This commit is contained in:
parent
62ed302bf4
commit
70b0e84476
6 changed files with 18 additions and 23 deletions
|
@ -5,10 +5,10 @@ Subject: [PATCH] Configurable damage tick when blocking with shield
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index ea983f83bb8d511e5a978cd4168888b705f94bbb..70f42996f722edc0435a75d22985940ffba9b409 100644
|
||||
index 882e3b6a58951f33a71f862bfa49a5b32d8e8f98..4827998c3b5ad72578de1310ab1c67671c21c5a2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -2412,7 +2412,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2411,7 +2411,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
CriteriaTriggers.PLAYER_HURT_ENTITY.trigger((ServerPlayer) damagesource.getEntity(), this, damagesource, originalDamage, f, true); // Paper - fix taken/dealt param order
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue