Skip to content

Commit

Permalink
fix issue with going back to vanilla durability on TE/IC2 based tools
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Dec 7, 2013
1 parent f28d288 commit f59ef6d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tconstruct/library/tools/AbilityHelper.java
Expand Up @@ -430,7 +430,7 @@ public static boolean damageElectricTool (ItemStack stack, NBTTagCompound tags,
float bonusLog = (float) Math.log(durability / 72f + 1) * 2 * stonebound;
trueSpeed += bonusLog;
trueSpeed *= 6;
if (charge > 0)
if (charge != -1)
{
if (charge < trueSpeed)
{
Expand All @@ -446,16 +446,16 @@ public static boolean damageElectricTool (ItemStack stack, NBTTagCompound tags,
if (entity instanceof EntityPlayer)
chargeFromArmor(stack, (EntityPlayer) entity);
}
if (energy > 0)
if (energy != -1)
{
if (energy < trueSpeed)
if (energy < trueSpeed * 2)
{
if (energy > 0)
tags.setInteger("Energy", 0);
return false;
}

energy -= trueSpeed;
energy -= trueSpeed * 2 ;
ToolCore tool = (ToolCore) stack.getItem();
stack.setItemDamage(1 + (tool.getMaxEnergyStored(stack) - energy) * (stack.getMaxDamage() - 1) / tool.getMaxEnergyStored(stack));
tags.setInteger("Energy", energy);
Expand Down

0 comments on commit f59ef6d

Please sign in to comment.