aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
authorAlex Bee <a.bramley@gmail.com>2023-12-03 12:26:45 +0000
committerGitHub <noreply@github.com>2023-12-03 13:26:45 +0100
commitb6f7c5da89d80ee2b4a73951f1063217e02f215c (patch)
treef027fdb8ba80c751aaee1b459323f8f22070e56d /src/main/java/gregtech/api
parent2568913fd034f727c6da252a6b2a845676dfd3b0 (diff)
downloadGT5-Unofficial-b6f7c5da89d80ee2b4a73951f1063217e02f215c.tar.gz
GT5-Unofficial-b6f7c5da89d80ee2b4a73951f1063217e02f215c.tar.bz2
GT5-Unofficial-b6f7c5da89d80ee2b4a73951f1063217e02f215c.zip
Plasma Mixer: only consume power when recipe starts. Fixes #14895. (#2375)
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/logic/ProcessingLogic.java18
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