diff --git a/src/main/java/org/cyclops/integratedcrafting/core/crafting/processoverride/CraftingProcessOverrideCraftingTable.java b/src/main/java/org/cyclops/integratedcrafting/core/crafting/processoverride/CraftingProcessOverrideCraftingTable.java index 1fe43655..b48b5489 100644 --- a/src/main/java/org/cyclops/integratedcrafting/core/crafting/processoverride/CraftingProcessOverrideCraftingTable.java +++ b/src/main/java/org/cyclops/integratedcrafting/core/crafting/processoverride/CraftingProcessOverrideCraftingTable.java @@ -19,6 +19,7 @@ import org.cyclops.integrateddynamics.api.part.PartPos; import java.util.Map; +import java.util.Optional; import java.util.UUID; import java.util.WeakHashMap; import java.util.function.Function; @@ -56,8 +57,13 @@ public boolean craft(Function, PartPos> targetGetter, return CraftingHelpers.findServerRecipe(RecipeType.CRAFTING, gridInput, level) .or(() -> { - CraftingGrid gridSmall = new CraftingGrid(ingredients, 2, 2); - return CraftingHelpers.findServerRecipe(RecipeType.CRAFTING, gridSmall.asCraftInput(), level); + try { + CraftingGrid gridSmall = new CraftingGrid(ingredients, 2, 2); + return CraftingHelpers.findServerRecipe(RecipeType.CRAFTING, gridSmall.asCraftInput(), level); + } catch (IllegalArgumentException e) { + // This can occur if the ingredients don't fit in a 2x2 grid. + return Optional.empty(); + } }) .map(recipeHolder -> { CraftingRecipe recipe = recipeHolder.value();