Skip to content

Commit

Permalink
Change necrotic modifier to only heal on actually alive mobs. This pr…
Browse files Browse the repository at this point in the history
…events lifesteal from test dummies and similar things.
  • Loading branch information
bonii-xx committed Jan 4, 2015
1 parent 724aa45 commit d408cab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/tconstruct/library/tools/AbilityHelper.java
Expand Up @@ -141,9 +141,11 @@ public static boolean onLeftClickEntity (ItemStack stack, EntityLivingBase playe
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)
Expand Down

0 comments on commit d408cab

Please sign in to comment.