Skip to content

Commit

Permalink
Don't immediately short-circuit "same ingredient" checks for shaped r…
Browse files Browse the repository at this point in the history
…ecipes

Some mods apparently have recipes for things such as blocks from ingots and ingots from nuggets where there is not just one distinct ingredient. In those cases, they'll typically have the recipe use an extra ingredient key where the ingredient is not the tag for some ingot/nuggets, but solely the mod's own respective ingot/nugget item. As unification mods such as AlmostUnified replace this item ingredient with the tag as usual, ingredient keys aren't completely sanitised and must therefore further be checked to ensure that the "non-distinct" ingredients do actually reference the same set of items.
Fixes #104.
  • Loading branch information
62832 committed Apr 21, 2024
1 parent 6b40e9b commit ed42e53
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ private boolean isCompressionRecipe(CraftingRecipe recipe, RegistryAccess access
private boolean sameIngredient(CraftingRecipe recipe) {
var ingredients = recipe.getIngredients();

if (recipe instanceof ShapedRecipe) {
return ingredients.stream().distinct().count() <= 1;
if (recipe instanceof ShapedRecipe && ingredients.stream().distinct().count() <= 1) {
return true;
}

// Check further for any odd cases (e.g. melon blocks having a shapeless recipe instead of a shaped one)
Expand Down

0 comments on commit ed42e53

Please sign in to comment.