Skip to content

Commit

Permalink
Flux modifier now requires the tool to have at least charge/1000 dura…
Browse files Browse the repository at this point in the history
…bility for the battery to be applicable.
  • Loading branch information
bonii-xx committed Oct 24, 2014
1 parent 2aa42a5 commit f734169
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/tconstruct/modifiers/tools/ModFlux.java
Expand Up @@ -46,6 +46,12 @@ public boolean matches (ItemStack[] input, ItemStack tool)
if (foundBattery == null)
return false;

int maxEnergy = ((IEnergyContainerItem) foundBattery.getItem()).getMaxEnergyStored(foundBattery);

// battery too big for our tool?
if(tags.getInteger("TotalDurability") < maxEnergy/1000) // durability needs to be at least 1/1000th of the charge
return false;

// check if we already have a flux modifier
if (tags.getBoolean(key))
{
Expand Down

0 comments on commit f734169

Please sign in to comment.