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

CoALs: Add missing styrene-butadiene variants for AssLine recipes. #239

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}