Skip to content

Commit

Permalink
Steam Turbine Fix (#1983)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoungOnionMC authored Sep 19, 2024
1 parent 228ebab commit 730daaf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ public static int limitByOutputMerging(@NotNull GTRecipe recipe, @NotNull IRecip
// If we are voiding items, reset the item limit to the maximum number of parallels
if (voiding) {
if (modifiedParallelAmounts.containsKey(cap)) {
modifiedParallelAmounts.put(cap, modifiedParallelAmounts.getInt(cap) + parallelAmount);
modifiedParallelAmounts.put(cap, Math.min(modifiedParallelAmounts.getInt(cap), parallelAmount));
} else {
modifiedParallelAmounts.put(cap, parallelAmount);
}
} else {
if (modifiedParallelAmounts.containsKey(cap)) {
modifiedParallelAmounts.put(cap, modifiedParallelAmounts.getInt(cap) +
cap.limitParallel(recipe, holder, parallelAmount));
modifiedParallelAmounts.put(cap, Math.min(modifiedParallelAmounts.getInt(cap),
cap.limitParallel(recipe, holder, parallelAmount)));
} else {
modifiedParallelAmounts.put(cap, cap.limitParallel(recipe, holder, parallelAmount));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.gregtechceu.gtceu.api.machine.multiblock.WorkableElectricMultiblockMachine;
import com.gregtechceu.gtceu.api.recipe.GTRecipe;
import com.gregtechceu.gtceu.api.recipe.RecipeHelper;
import com.gregtechceu.gtceu.api.recipe.content.ContentModifier;
import com.gregtechceu.gtceu.api.recipe.logic.OCParams;
import com.gregtechceu.gtceu.api.recipe.logic.OCResult;
import com.gregtechceu.gtceu.common.data.GTRecipeModifiers;
Expand Down Expand Up @@ -114,6 +115,14 @@ public static GTRecipe recipeModifier(MetaMachine machine, @NotNull GTRecipe rec

long eut = turbineMachine.boostProduction((long) (EUt * holderEfficiency * parallelResult.getSecond()));

recipe = new GTRecipe(recipe.recipeType, recipe.id,
recipe.copyContents(recipe.inputs, ContentModifier.multiplier(parallelResult.getSecond())),
recipe.copyContents(recipe.outputs, ContentModifier.multiplier(parallelResult.getSecond())),
recipe.tickInputs, recipe.tickOutputs, recipe.inputChanceLogics, recipe.outputChanceLogics,
recipe.tickInputChanceLogics, recipe.tickOutputChanceLogics, recipe.conditions,
recipe.ingredientActions,
recipe.data, recipe.duration, recipe.isFuel);

result.init(-eut, recipe.duration, parallelResult.getSecond(), params.getOcAmount());

return recipe;
Expand Down

0 comments on commit 730daaf

Please sign in to comment.