[1.12.2] Arc Furnace recipes do not consume multiple items from the input slot
sam-kirby opened this issue ยท 2 comments
Description of the issue:
Taking a contrived example - double the recipe for constantan - 2 copper ingots, 2 nickel grit produces 4 constantan ingots
import mods.immersiveengineering.ArcFurnace;
ArcFurnace.removeRecipe(<immersiveengineering:metal:6>);
ArcFurnace.addRecipe(<immersiveengineering:metal:6> * 4, <immersiveengineering:metal> * 2, <ore:itemSlag>.firstItem, 200, 512, [<immersiveengineering:metal:13> * 2]);
In this case, the arc furnace will consume only 1 copper ingot. It correctly consumes 2 nickel grit and produces 4 constantan ingots. It will not begin running however if you only insert one copper ingot, and will stop when only one remains.
A real world example that involves other mods would be a recipe for bronze - 3 copper ingots + 1 tin grit produces 4 bronze ingots.
Recipes that consume more than one of an input stack but have no additives are also affected.
Versions & Modlist
Reproduced in minimal environment
Forge - 14.23.5.2815
IE - 0.12-89
CraftTweaker - 4.1.17
Possible Fix (tested - working)
It appears when additives are present, IE forces the process to only consume 1 of the input stack regardless of what is specified by the recipe.
After further testing and feedback from md5i, I discovered this line is also executed when no additives are present. It's not immediately clear if this is intentional as I am unaware of the intended circumstances in which ArcFurnaceRecipe#getConsumedAdditives returns null.
Good news is the proposed change below resolves both cases though.
Index: src/main/java/blusunrize/immersiveengineering/common/blocks/metal/TileEntityArcFurnace.java
===================================================================
--- src/main/java/blusunrize/immersiveengineering/common/blocks/metal/TileEntityArcFurnace.java (revision 10e24d1bfddebfb1fe5065a162d801a0625b39ec)
+++ src/main/java/blusunrize/immersiveengineering/common/blocks/metal/TileEntityArcFurnace.java (date 1555061399000)
@@ -146,7 +146,7 @@
this.addProcessToQueue(process, false);
int[] consumedAdditives = recipe.getConsumedAdditives(additives, true);
if(consumedAdditives!=null)
- process.setInputAmounts(1, consumedAdditives[0], consumedAdditives[1], consumedAdditives[2], consumedAdditives[3]);
+ process.setInputAmounts(recipe.input.inputSize, consumedAdditives[0], consumedAdditives[1], consumedAdditives[2], consumedAdditives[3]);
// update = true;
}
}
I have the same problem, tried your suggestion and it worked, for me, like a charm.