From f734169ad6c6895c38cdbfef5640f160e64bb8de Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Fri, 24 Oct 2014 11:52:19 +0200 Subject: [PATCH] Flux modifier now requires the tool to have at least charge/1000 durability for the battery to be applicable. --- src/main/java/tconstruct/modifiers/tools/ModFlux.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/tconstruct/modifiers/tools/ModFlux.java b/src/main/java/tconstruct/modifiers/tools/ModFlux.java index 3be1d427713..0dff3c1e4f0 100644 --- a/src/main/java/tconstruct/modifiers/tools/ModFlux.java +++ b/src/main/java/tconstruct/modifiers/tools/ModFlux.java @@ -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)) {