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

Fix Bio Vat internal error & scanner info #394

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Changes from 1 commit
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 @@ -260,14 +260,24 @@ protected CheckRecipeResult validateRecipe(@NotNull GT_Recipe recipe) {
@NotNull
@Override
protected GT_ParallelHelper createParallelHelper(@NotNull GT_Recipe recipe) {
return super.createParallelHelper(recipeWithMultiplier(recipe));
return super.createParallelHelper(recipeWithMultiplier(recipe, inputFluids));
}
};
}

protected GT_Recipe recipeWithMultiplier(GT_Recipe recipe) {
protected GT_Recipe recipeWithMultiplier(GT_Recipe recipe, FluidStack[] fluidInputs) {
GT_Recipe tRecipe = recipe.copy();
int multiplier = getExpectedMultiplier(recipe.getFluidOutput(0), true);
mExpectedMultiplier = multiplier;
long fluidAmount = 0;
for (FluidStack fluid : fluidInputs) {
if (recipe.mFluidInputs[0].isFluidEqual(fluid)) {
fluidAmount += fluid.amount;
}
}
multiplier = (int) Math.min(multiplier, fluidAmount / recipe.mFluidInputs[0].amount);
multiplier = Math.max(multiplier, 1);
mTimes = multiplier;
tRecipe.mFluidInputs[0].amount *= multiplier;
tRecipe.mFluidOutputs[0].amount *= multiplier;
return tRecipe;
Expand Down