diff --git a/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java b/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java index 1c45de8807a..cc5731410bd 100644 --- a/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java +++ b/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java @@ -70,22 +70,19 @@ public int getCapacity () public int updateCapacity () // Only used to initialize { - int ret = TConstruct.ingotLiquidValue; - ItemStack inv = inventory[0]; + int ret = TConstruct.ingotLiquidValue; + int rec = TConstruct.basinCasting.getCastingAmount(this.liquid, inv); - if (inv != null && inv.getItem() instanceof IPattern) - { - int cost = ((IPattern) inv.getItem()).getPatternCost(inv); - if (cost > 0) - ret *= ((IPattern) inv.getItem()).getPatternCost(inv) * 0.5; - else - ret = TConstruct.basinCasting.getCastingAmount(this.liquid, inv); - } - - else - { - ret = TConstruct.basinCasting.getCastingAmount(this.liquid, inv); + if (rec > 0) + ret = rec; + else { + if (inv != null && inv.getItem() instanceof IPattern) + { + int cost = ((IPattern) inv.getItem()).getPatternCost(inv); + if (cost > 0) + ret *= ((IPattern) inv.getItem()).getPatternCost(inv) * 0.5; + } } TConstruct.logger.info("Ret: " + ret); @@ -96,20 +93,19 @@ public int updateCapacity (int capacity) { int ret = TConstruct.ingotLiquidValue; - ItemStack inv = inventory[0]; + if (capacity > 0) + ret = capacity; + else { + ItemStack inv = inventory[0]; - if (inv != null && inv.getItem() instanceof IPattern) - { - int cost = ((IPattern) inv.getItem()).getPatternCost(inv); - if (cost > 0) - ret *= ((IPattern) inv.getItem()).getPatternCost(inv) * 0.5; - else - ret = capacity; + if (inv != null && inv.getItem() instanceof IPattern) + { + int cost = ((IPattern) inv.getItem()).getPatternCost(inv); + if (cost > 0) + ret *= cost * 0.5; + } } - else - ret = capacity; - return ret; } diff --git a/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java b/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java index 7ffa5fc81a1..ab8cf13da19 100644 --- a/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java +++ b/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java @@ -70,22 +70,19 @@ public int getCapacity () public int updateCapacity () // Only used to initialize { - int ret = TConstruct.ingotLiquidValue; - ItemStack inv = inventory[0]; + int ret = TConstruct.ingotLiquidValue; + int rec = TConstruct.tableCasting.getCastingAmount(this.liquid, inv); - if (inv != null && inv.getItem() instanceof IPattern) - { - int cost = ((IPattern) inv.getItem()).getPatternCost(inv); - if (cost > 0) - ret *= ((IPattern) inv.getItem()).getPatternCost(inv) * 0.5; - else - ret = TConstruct.tableCasting.getCastingAmount(this.liquid, inv); - } - - else - { - ret = TConstruct.tableCasting.getCastingAmount(this.liquid, inv); + if (rec > 0) + ret = rec; + else { + if (inv != null && inv.getItem() instanceof IPattern) + { + int cost = ((IPattern) inv.getItem()).getPatternCost(inv); + if (cost > 0) + ret *= ((IPattern) inv.getItem()).getPatternCost(inv) * 0.5; + } } TConstruct.logger.info("Ret: " + ret); @@ -96,20 +93,19 @@ public int updateCapacity (int capacity) { int ret = TConstruct.ingotLiquidValue; - ItemStack inv = inventory[0]; + if (capacity > 0) + ret = capacity; + else { + ItemStack inv = inventory[0]; - if (inv != null && inv.getItem() instanceof IPattern) - { - int cost = ((IPattern) inv.getItem()).getPatternCost(inv); - if (cost > 0) - ret *= ((IPattern) inv.getItem()).getPatternCost(inv) * 0.5; - else - ret = capacity; + if (inv != null && inv.getItem() instanceof IPattern) + { + int cost = ((IPattern) inv.getItem()).getPatternCost(inv); + if (cost > 0) + ret *= cost * 0.5; + } } - else - ret = capacity; - return ret; }