diff --git a/src/main/java/gregtech/api/logic/ProcessingLogic.java b/src/main/java/gregtech/api/logic/ProcessingLogic.java index 9e311043f6d..6983cfe9d42 100644 --- a/src/main/java/gregtech/api/logic/ProcessingLogic.java +++ b/src/main/java/gregtech/api/logic/ProcessingLogic.java @@ -398,7 +398,7 @@ private CalculationResult validateAndCalculateRecipe(@Nonnull GTRecipe recipe) { * At this point, inputs have been already consumed. */ @Nonnull - private CheckRecipeResult applyRecipe(@Nonnull GTRecipe recipe, @Nonnull ParallelHelper helper, + protected CheckRecipeResult applyRecipe(@Nonnull GTRecipe recipe, @Nonnull ParallelHelper helper, @Nonnull OverclockCalculator calculator, @Nonnull CheckRecipeResult result) { if (recipe.mCanBeBuffered) { lastRecipe = recipe; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTESolarFactory.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTESolarFactory.java index 3ddae49d0e9..0855c4aa351 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTESolarFactory.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTESolarFactory.java @@ -54,6 +54,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GTRecipe; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.api.util.OverclockCalculator; import gregtech.api.util.ParallelHelper; import gregtech.api.util.recipe.SolarFactoryRecipeData; @@ -70,12 +71,6 @@ public class MTESolarFactory extends MTEExtendedPowerMultiBlockBase pair : validWafers) { @@ -329,6 +296,27 @@ private void findWaferStack() { } } + private void clearVars() { + foundWaferStack = null; + waferAmountInRecipe = 0; + foundWaferTier = 0; + minimumTierForRecipe = 0; + shouldMultiplyOutputs = true; + } + + @Override + protected @NotNull CheckRecipeResult applyRecipe(@NotNull GTRecipe recipe, @NotNull ParallelHelper helper, + @NotNull OverclockCalculator calculator, @NotNull CheckRecipeResult result) { + result = super.applyRecipe(recipe, helper, calculator, result); + if (shouldMultiplyOutputs) { + // We multiply outputs here since its after parallels are calculated, however this is after void + // protection checks so void protection is not supported. + outputItems = calculateNewOutput(outputItems[0], (foundWaferTier - minimumTierForRecipe)); + } + clearVars(); + return result; + } + @NotNull @Override public CheckRecipeResult validateRecipe(@NotNull GTRecipe recipe) {