Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
CoALs: Add missing styrene-butadiene variants for AssLine recipes. (#239
Browse files Browse the repository at this point in the history
)
  • Loading branch information
fluffle authored Mar 12, 2024
1 parent a89e014 commit af38e95
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
});
Expand Down Expand Up @@ -442,4 +457,15 @@ private static void addEternityForMHDCSM(ArrayList<FluidStack> fluidInputs) {
fluidInputs.add(MaterialsUEVplus.Eternity.getMolten(mhdcsmAmount - 576 * 48));
}
}

private static boolean swapSiliconeForStyreneButadiene(ArrayList<FluidStack> 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;
}
}

0 comments on commit af38e95

Please sign in to comment.