Fix swrod of the cosmos firing onDeath twice for some mobs (#90)

This commit is contained in:
nimuck authored and GitHub committed 2026-11-25 13:26:25 +01:00
1 parent 9412321283
commit 7e2f217abe
1 file changed
+6 -3
@@ -69,9 +69,12 @@ public class ItemSwordInfinity extends ItemSword implements ICosmicRenderItem, I
victim.func_110142_aN() // getCombatTracker
.func_94547_a(new DamageSourceInfinitySword(player), victim.getHealth(), victim.getHealth());
if (executionEnabled) {
victim.setHealth(0);
if (Belmont.isVampire(victim)) victim.onDeath(new EntityDamageSource("infinity", player).setFireDamage());
else victim.onDeath(new EntityDamageSource("infinity", player));
if (victim.getHealth() > 0) {
victim.setHealth(0);
if (Belmont.isVampire(victim))
victim.onDeath(new EntityDamageSource("infinity", player).setFireDamage());
else victim.onDeath(new EntityDamageSource("infinity", player));
}
return true;
}
victim.attackEntityFrom(new DamageSourceInfinitySword(player).setDamageBypassesArmor(), attackDamage);