diff options
author | Steelux <70096037+Steelux8@users.noreply.github.com> | 2022-03-04 17:45:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-04 17:45:14 +0000 |
commit | 8e7f8a5e069cf7cda5d38aabeafcb4ac0f54dea3 (patch) | |
tree | 202cf6b0ae33ecd7b7593a206a34f9b0e8d25371 /src/main/java/gtPlusPlus/xmod/gregtech/loaders | |
parent | 04f287d6f5f86ce8b492d074ee0f783c38bb0387 (diff) | |
download | GT5-Unofficial-8e7f8a5e069cf7cda5d38aabeafcb4ac0f54dea3.tar.gz GT5-Unofficial-8e7f8a5e069cf7cda5d38aabeafcb4ac0f54dea3.tar.bz2 GT5-Unofficial-8e7f8a5e069cf7cda5d38aabeafcb4ac0f54dea3.zip |
Changed EBF faster recipes to not have circuit 1s (#146)
* Changed EBF faster recipes to not have circuit 1s
- Changed the ABS recipes taken from the EBF recipe map to ask for different circuits on the recipes that use a fluid input to reduce crafting time for specific dusts.
* Cleaning a bit
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/loaders')
-rw-r--r-- | src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java index 3e54a7fe5d..3ea1eeef62 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java @@ -158,20 +158,38 @@ public class RecipeGen_BlastSmelterGT_GTNH { } //If this recipe is enabled and we have a valid molten fluidstack, let's try add this recipe. if (enabled && isValid(inputs, outputs, inputsF, mMoltenStack)) { + // Boolean to decide whether or not to create a new circuit later + boolean circuitFound = false; + //Build correct input stack ArrayList<ItemStack> aTempList = new ArrayList<ItemStack>(); - for (ItemStack aPossibleCircuit : inputs) { - if (!ItemUtils.isControlCircuit(aPossibleCircuit)) { - aTempList.add(aPossibleCircuit); + for (ItemStack recipeItem : inputs) { + if (ItemUtils.isControlCircuit(recipeItem)) { + circuitFound = true; } + aTempList.add(recipeItem); } + inputs = aTempList.toArray(new ItemStack[aTempList.size()]); - ItemStack[] newInput = new ItemStack[inputs.length+1]; - int l = 1; + int inputLength = inputs.length; + // If no circuit was found, increase array length by 1 to add circuit at newInput[0] + if (!circuitFound) { + inputLength++; + } + + ItemStack[] newInput = new ItemStack[inputLength]; + + int l = 0; + // If no circuit was found, add a circuit here + if (!circuitFound) { + l = 1; + newInput[0] = CI.getNumberedCircuit(inputs.length); + } + for (ItemStack y : inputs) { newInput[l++] = y; } - newInput[0] = CI.getNumberedCircuit(inputs.length); + //Logger.MACHINE_INFO("[ABS] Generating ABS recipe for "+mMoltenStack.getLocalizedName()+"."); if (CORE.RA.addBlastSmelterRecipe(newInput, (inputsF.length > 0 ? inputsF[0] : null), mMoltenStack, 100, MathUtils.roundToClosestInt(time*0.8), voltage, special)) { //Logger.MACHINE_INFO("[ABS] Success."); |