From da7eb6b9429357bc465e1e576f323d8e258f3c0e Mon Sep 17 00:00:00 2001 From: Melncat Date: Fri, 18 Nov 2022 20:04:52 -0800 Subject: [PATCH] Fix MC-121048 (#8429) This moves the setHealth call to below the recordDamage call to prevent recordDamage from clearing the CombatTracker, since recordDamage will clear the CombatTracker if the entity is dead. This fixes death messages such as the "doomed to fall" messages. --- patches/server/Fix-MC-121048.patch | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 patches/server/Fix-MC-121048.patch diff --git a/patches/server/Fix-MC-121048.patch b/patches/server/Fix-MC-121048.patch new file mode 100644 index 0000000000..7de55f4dee --- /dev/null +++ b/patches/server/Fix-MC-121048.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MelnCat +Date: Mon, 3 Oct 2022 07:53:37 -0700 +Subject: [PATCH] Fix MC-121048 + +This moves the setHealth call to below the recordDamage call to prevent +recordDamage from clearing the CombatTracker, since recordDamage will +clear the CombatTracker if the entity is dead. This fixes death messages +such as the "doomed to fall" messages. + +diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java ++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { + // CraftBukkit end + float f3 = this.getHealth(); + +- this.setHealth(f3 - f); ++ // Paper start - MC-121048 + this.getCombatTracker().recordDamage(damagesource, f3, f); ++ this.setHealth(f3 - f); ++ // Paper end + // CraftBukkit start + if (!human) { + this.setAbsorptionAmount(this.getAbsorptionAmount() - f);