Fix killing blows not giving lifesteal #1436

This commit is contained in:
Bernhard Bonigl committed 2015-03-02 15:54:30 +01:00
1 parent c34ab3db63
commit a544071e0e
1 file changed
+2 -1
@@ -112,6 +112,7 @@ public class AbilityHelper
damage = 1;
}
boolean causedDamage = false;
boolean isAlive = entity.isEntityAlive();
if (tool.pierceArmor() && !broken)
{
if (player instanceof EntityPlayer)
@@ -135,7 +136,7 @@ public class AbilityHelper
tool.onEntityDamaged(player.worldObj, player, entity);
if (!necroticUHS || (entity instanceof IMob && entity instanceof EntityLivingBase && ((EntityLivingBase) entity).getHealth() <= 0))
{
if(entity.isEntityAlive()) {
if(isAlive) {
int drain = toolTags.getInteger("Necrotic") * 2;
if (drain > 0)
player.heal(random.nextInt(drain + 1));