diff options
Diffstat (limited to 'src/main/java/gregtech/api')
4 files changed, 28 insertions, 16 deletions
diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java index 67371a3a9a..d0c9399980 100644 --- a/src/main/java/gregtech/api/enums/OrePrefixes.java +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -1190,20 +1190,21 @@ public enum OrePrefixes { return; } - if ((aMaterial != Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) - && GT_Utility.isStackValid(aStack)) { - // if (Materials.mPreventableComponents.contains(this) && !this.mDynamicItems.contains(aMaterial)) return; - for (IOreRecipeRegistrator tRegistrator : mOreProcessing) { - if (D2) GT_Log.ore.println( - "Processing '" + aOreDictName - + "' with the Prefix '" - + name() - + "' and the Material '" - + aMaterial.mName - + "' at " - + GT_Utility.getClassName(tRegistrator)); - tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack)); - } + if (!((aMaterial != Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) + && GT_Utility.isStackValid(aStack))) { + return; + } + + for (IOreRecipeRegistrator tRegistrator : mOreProcessing) { + if (D2) GT_Log.ore.println( + "Processing '" + aOreDictName + + "' with the Prefix '" + + name() + + "' and the Material '" + + aMaterial.mName + + "' at " + + GT_Utility.getClassName(tRegistrator)); + tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack)); } } diff --git a/src/main/java/gregtech/api/recipe/RecipeMap.java b/src/main/java/gregtech/api/recipe/RecipeMap.java index 8ca9748f4f..46b32d18dd 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMap.java +++ b/src/main/java/gregtech/api/recipe/RecipeMap.java @@ -1,5 +1,7 @@ package gregtech.api.recipe; +import static gregtech.api.util.GT_RecipeBuilder.ENABLE_COLLISION_CHECK; + import java.util.Collection; import java.util.HashMap; import java.util.List; @@ -125,7 +127,7 @@ public final class RecipeMap<B extends RecipeMapBackend> implements IRecipeMap { aRecipe.mFakeRecipe = aFakeRecipe; if (aRecipe.mFluidInputs.length < backend.properties.minFluidInputs && aRecipe.mInputs.length < backend.properties.minItemInputs) return null; - if (aCheckForCollisions && backend.checkCollision(aRecipe)) return null; + if (aCheckForCollisions && ENABLE_COLLISION_CHECK && backend.checkCollision(aRecipe)) return null; return backend.compileRecipe(aRecipe); } diff --git a/src/main/java/gregtech/api/recipe/RecipeMapBackend.java b/src/main/java/gregtech/api/recipe/RecipeMapBackend.java index e41409fd51..8ba0895a7f 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMapBackend.java +++ b/src/main/java/gregtech/api/recipe/RecipeMapBackend.java @@ -1,5 +1,6 @@ package gregtech.api.recipe; +import static gregtech.api.util.GT_RecipeBuilder.ENABLE_COLLISION_CHECK; import static gregtech.api.util.GT_RecipeBuilder.handleInvalidRecipe; import static gregtech.api.util.GT_RecipeBuilder.handleRecipeCollision; import static gregtech.api.util.GT_Utility.areStacksEqualOrNull; @@ -179,7 +180,7 @@ public class RecipeMapBackend { recipe = properties.recipeTransformer.apply(recipe); } if (recipe == null) continue; - if (builder.isCheckForCollision() && checkCollision(recipe)) { + if (builder.isCheckForCollision() && ENABLE_COLLISION_CHECK && checkCollision(recipe)) { handleCollision(recipe); continue; } diff --git a/src/main/java/gregtech/api/util/GT_RecipeBuilder.java b/src/main/java/gregtech/api/util/GT_RecipeBuilder.java index e8ae449c2d..137b7d6c86 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeBuilder.java +++ b/src/main/java/gregtech/api/util/GT_RecipeBuilder.java @@ -37,13 +37,20 @@ public class GT_RecipeBuilder { // debug mode expose problems. panic mode help you check nothing is wrong-ish without you actively monitoring private static final boolean DEBUG_MODE_NULL; + // Any stable release should be tested at least once with this: -Dgt.recipebuilder.panic.null=true private static boolean PANIC_MODE_NULL; private static final boolean DEBUG_MODE_INVALID; private static final boolean DEBUG_MODE_FULL_ENERGY; + // Any stable release should be tested at least once with this: -Dgt.recipebuilder.panic.invalid=true private static final boolean PANIC_MODE_INVALID; private static final boolean DEBUG_MODE_COLLISION; + + // Any stable release should be tested at least once with this: -Dgt.recipebuilder.panic.collision=true private static final boolean PANIC_MODE_COLLISION; + // This should only be enabled in non stable instances only with -Dgt.recipebuilder.recipe_collision_check=true + public static final boolean ENABLE_COLLISION_CHECK; + public static final int WILDCARD = 32767; // time units @@ -78,6 +85,7 @@ public class GT_RecipeBuilder { PANIC_MODE_NULL = panicAll || Boolean.getBoolean("gt.recipebuilder.panic.null"); PANIC_MODE_INVALID = panicAll || Boolean.getBoolean("gt.recipebuilder.panic.invalid"); PANIC_MODE_COLLISION = panicAll || Boolean.getBoolean("gt.recipebuilder.panic.collision"); + ENABLE_COLLISION_CHECK = Boolean.getBoolean("gt.recipebuilder.recipe_collision_check"); } protected ItemStack[] inputsBasic = new ItemStack[0]; |