Change necrotic modifier to only heal on actually alive mobs. This prevents lifesteal from test dummies and similar things.

This commit is contained in:
Bernhard Bonigl committed 2015-01-05 00:16:57 +01:00
1 parent 724aa45b94
commit d408caba71
1 file changed
+5 -3
@@ -141,9 +141,11 @@ public class AbilityHelper
tool.onEntityDamaged(player.worldObj, player, entity);
if (!necroticUHS || (entity instanceof IMob && entity instanceof EntityLivingBase && ((EntityLivingBase) entity).getHealth() <= 0))
{
int drain = toolTags.getInteger("Necrotic") * 2;
if (drain > 0)
player.heal(random.nextInt(drain + 1));
if(entity.isEntityAlive()) {
int drain = toolTags.getInteger("Necrotic") * 2;
if (drain > 0)
player.heal(random.nextInt(drain + 1));
}
}
if (knockback > 0)