Flux modifier now requires the tool to have at least charge/1000 durability for the battery to be applicable.

This commit is contained in:
Bernhard Bonigl committed 2014-10-24 11:52:19 +02:00
1 parent 2aa42a5b8a
commit f734169ad6
1 file changed
+6
@@ -46,6 +46,12 @@ public class ModFlux extends ModBoolean
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))
{