aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim <maxim235@gmx.de>2023-07-22 14:42:04 +0200
committerGitHub <noreply@github.com>2023-07-22 14:42:04 +0200
commit5c55677074291927db1cf6ff2a9de208d86e2cac (patch)
tree235d9187bda7a99bc796752cf578bd8769929ccf
parentb2eb57f4794e45f513eedd54e04cef9183b38144 (diff)
downloadGT5-Unofficial-5c55677074291927db1cf6ff2a9de208d86e2cac.tar.gz
GT5-Unofficial-5c55677074291927db1cf6ff2a9de208d86e2cac.tar.bz2
GT5-Unofficial-5c55677074291927db1cf6ff2a9de208d86e2cac.zip
Exposed recipe consumption via method (#2162)
* Exposed recipe consumption via method
-rw-r--r--src/main/java/gregtech/api/util/GT_ParallelHelper.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/util/GT_ParallelHelper.java b/src/main/java/gregtech/api/util/GT_ParallelHelper.java
index 46a646356d..47b8ba17fb 100644
--- a/src/main/java/gregtech/api/util/GT_ParallelHelper.java
+++ b/src/main/java/gregtech/api/util/GT_ParallelHelper.java
@@ -289,6 +289,18 @@ public class GT_ParallelHelper {
}
/**
+ * Try to consume the inputs of the recipe
+ *
+ * @param recipe Processed recipe
+ * @param fluids fluid inputs that will be consumed
+ * @param items item inputs that will be consumed
+ * @return True if recipe was satisfied, else false
+ */
+ protected boolean tryConsumeRecipeInputs(GT_Recipe recipe, FluidStack[] fluids, ItemStack[] items) {
+ return recipe.isRecipeInputEqual(true, false, fluids, items);
+ }
+
+ /**
* Called by build(). Determines the parallels and everything else that needs to be done at build time
*/
protected void determineParallel() {
@@ -366,7 +378,7 @@ public class GT_ParallelHelper {
boolean builtRecipeCheck = false;
for (; mCurrentParallel < maxParallelBeforeBatchMode
&& tCurrentUsage < (mAvailableEUt - tRecipeEUt); mCurrentParallel++) {
- if (!mRecipe.isRecipeInputEqual(true, false, tFluidInputs, tItemInputs)) {
+ if (!tryConsumeRecipeInputs(mRecipe, tFluidInputs, tItemInputs)) {
break;
}
tCurrentUsage += tRecipeEUt;
@@ -390,7 +402,7 @@ public class GT_ParallelHelper {
tExtraParallels = recipeCheck.checkRecipeInputs(true, maxExtraParallels, tItemInputs, tFluidInputs);
} else {
while (tExtraParallels < maxExtraParallels
- && mRecipe.isRecipeInputEqual(true, false, tFluidInputs, tItemInputs)) {
+ && tryConsumeRecipeInputs(mRecipe, tFluidInputs, tItemInputs)) {
tExtraParallels++;
}
}