diff options
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r-- | src/main/java/gregtech/api/logic/ProcessingLogic.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/logic/ProcessingLogic.java b/src/main/java/gregtech/api/logic/ProcessingLogic.java index 4758af3254..803abafbe3 100644 --- a/src/main/java/gregtech/api/logic/ProcessingLogic.java +++ b/src/main/java/gregtech/api/logic/ProcessingLogic.java @@ -378,6 +378,11 @@ public class ProcessingLogic { } duration = (int) finalDuration; + CheckRecipeResult hookResult = onRecipeStart(recipe); + if (!hookResult.wasSuccessful()) { + return hookResult; + } + outputItems = helper.getItemOutputs(); outputFluids = helper.getFluidOutputs(); @@ -471,6 +476,19 @@ public class ProcessingLogic { .setEUtIncreasePerOC(overClockPowerIncrease); } + /** + * Override to perform additional logic when recipe starts. + * + * This is called when the recipe processing logic has finished all + * checks, consumed all inputs, but has not yet set the outputs to + * be produced. Returning a result other than SUCCESSFUL will void + * all inputs! + */ + @Nonnull + protected CheckRecipeResult onRecipeStart(@Nonnull GT_Recipe recipe) { + return CheckRecipeResultRegistry.SUCCESSFUL; + } + // endregion // region Getters |