diff options
author | chochem <40274384+chochem@users.noreply.github.com> | 2024-09-23 21:07:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-23 20:07:16 +0000 |
commit | 2368c35601a37fe60fe45b1f454dd48a8c3f43c6 (patch) | |
tree | 4c8cac7f1dac8bf3a65ac6acac519d67a5ffe672 /src/main | |
parent | 1abc736829841c8700b24b33d1936771a1956191 (diff) | |
download | GT5-Unofficial-2368c35601a37fe60fe45b1f454dd48a8c3f43c6.tar.gz GT5-Unofficial-2368c35601a37fe60fe45b1f454dd48a8c3f43c6.tar.bz2 GT5-Unofficial-2368c35601a37fe60fe45b1f454dd48a8c3f43c6.zip |
More log entries for ra2 failing (#3267)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/gregtech/api/recipe/RecipeMapBackend.java | 15 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTRecipeBuilder.java | 24 |
2 files changed, 36 insertions, 3 deletions
diff --git a/src/main/java/gregtech/api/recipe/RecipeMapBackend.java b/src/main/java/gregtech/api/recipe/RecipeMapBackend.java index 1122eaf869..c1f8afffeb 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMapBackend.java +++ b/src/main/java/gregtech/api/recipe/RecipeMapBackend.java @@ -2,6 +2,8 @@ package gregtech.api.recipe; import static gregtech.api.util.GTRecipeBuilder.ENABLE_COLLISION_CHECK; import static gregtech.api.util.GTRecipeBuilder.handleInvalidRecipe; +import static gregtech.api.util.GTRecipeBuilder.handleInvalidRecipeLowFluids; +import static gregtech.api.util.GTRecipeBuilder.handleInvalidRecipeLowItems; import static gregtech.api.util.GTRecipeBuilder.handleRecipeCollision; import static gregtech.api.util.GTUtility.areStacksEqualOrNull; @@ -172,14 +174,21 @@ public class RecipeMapBackend { Iterable<? extends GTRecipe> recipes = properties.recipeEmitter.apply(builder); Collection<GTRecipe> ret = new ArrayList<>(); for (GTRecipe recipe : recipes) { - if (recipe.mFluidInputs.length < properties.minFluidInputs - || recipe.mInputs.length < properties.minItemInputs) { + if (recipe.mInputs.length < properties.minItemInputs) { + handleInvalidRecipeLowItems(); + return Collections.emptyList(); + } + if (recipe.mFluidInputs.length < properties.minFluidInputs) { + handleInvalidRecipeLowFluids(); return Collections.emptyList(); } if (properties.recipeTransformer != null) { recipe = properties.recipeTransformer.apply(recipe); } - if (recipe == null) continue; + if (recipe == null) { + handleInvalidRecipe(); + continue; + } if (builder.isCheckForCollision() && ENABLE_COLLISION_CHECK && checkCollision(recipe)) { handleCollision(recipe); continue; diff --git a/src/main/java/gregtech/api/util/GTRecipeBuilder.java b/src/main/java/gregtech/api/util/GTRecipeBuilder.java index 1426c1c264..69890e564d 100644 --- a/src/main/java/gregtech/api/util/GTRecipeBuilder.java +++ b/src/main/java/gregtech/api/util/GTRecipeBuilder.java @@ -211,6 +211,30 @@ public class GTRecipeBuilder { } } + public static void handleInvalidRecipeLowFluids() { + if (!DEBUG_MODE_INVALID && !PANIC_MODE_INVALID) { + return; + } + // place a breakpoint here to catch all these issues + GTLog.err.println("invalid recipe: not enough input fluids"); + new IllegalArgumentException().printStackTrace(GTLog.err); + if (PANIC_MODE_INVALID) { + throw new IllegalArgumentException("invalid recipe"); + } + } + + public static void handleInvalidRecipeLowItems() { + if (!DEBUG_MODE_INVALID && !PANIC_MODE_INVALID) { + return; + } + // place a breakpoint here to catch all these issues + GTLog.err.println("invalid recipe: not enough input items"); + new IllegalArgumentException().printStackTrace(GTLog.err); + if (PANIC_MODE_INVALID) { + throw new IllegalArgumentException("invalid recipe"); + } + } + public static void handleRecipeCollision(String details) { if (!DEBUG_MODE_COLLISION && !PANIC_MODE_COLLISION) { return; |