From 4caa11dbf01fdc7a362745da588843ef77042895 Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Tue, 27 Feb 2024 15:46:38 +0000 Subject: [PATCH] CoALs: Add missing styrene-butadiene variants for AssLine recipes. --- .../ComponentAssemblyLineRecipeLoader.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/main/java/goodgenerator/loader/ComponentAssemblyLineRecipeLoader.java b/src/main/java/goodgenerator/loader/ComponentAssemblyLineRecipeLoader.java index 18fda2f1..a77dfad5 100644 --- a/src/main/java/goodgenerator/loader/ComponentAssemblyLineRecipeLoader.java +++ b/src/main/java/goodgenerator/loader/ComponentAssemblyLineRecipeLoader.java @@ -176,6 +176,21 @@ private static void generateAsslineRecipes() { recipe.mDuration * INPUT_MULTIPLIER, // Takes as long as this many recipe.mEUt, info.getRight()); // Casing tier + + // Add a second recipe using Styrene-Butadiene + // Rubber instead of Silicone Rubber. + // This relies on silicone rubber being first in + // @allSyntheticRubber so it's quite fragile, but + // it's also the least invasive change. + if (swapSiliconeForStyreneButadiene(fixedFluids)) { + MyRecipeAdder.instance.addComponentAssemblyLineRecipe( + fixedInputs.toArray(new ItemStack[0]), + fixedFluids.toArray(new FluidStack[0]), + info.getLeft().get(OUTPUT_MULTIPLIER), // The component output + recipe.mDuration * INPUT_MULTIPLIER, // Takes as long as this many + recipe.mEUt, + info.getRight()); // Casing tier + } } } }); @@ -442,4 +457,15 @@ private static void addEternityForMHDCSM(ArrayList fluidInputs) { fluidInputs.add(MaterialsUEVplus.Eternity.getMolten(mhdcsmAmount - 576 * 48)); } } + + private static boolean swapSiliconeForStyreneButadiene(ArrayList fluidInputs) { + for (int i = 0; i < fluidInputs.size(); i++) { + FluidStack fluidstack = fluidInputs.get(i); + if (fluidstack.getFluid().equals(FluidRegistry.getFluid("molten.silicone"))) { + fluidInputs.set(i, FluidRegistry.getFluidStack("molten.styrenebutadienerubber", fluidstack.amount)); + return true; + } + } + return false; + } }