Skip to content

Commit

Permalink
Merge branch 'port/1.21' into features/gradle-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n authored Jun 10, 2024
2 parents 50ea26b + b40311c commit 75c0a37
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
}

@Override
@@ -54,6 +_,8 @@
@@ -54,6 +_,12 @@
public boolean matches(CraftingInput p_346123_, Level p_44263_) {
if (p_346123_.ingredientCount() != this.ingredients.size()) {
return false;
+ } else if (!isSimple) {
+ return net.neoforged.neoforge.common.util.RecipeMatcher.findMatches(p_346123_.items(), this.ingredients) != null;
+ var nonEmptyItems = new java.util.ArrayList<ItemStack>(p_346123_.ingredientCount());
+ for (var item : p_346123_.items())
+ if (!item.isEmpty())
+ nonEmptyItems.add(item);
+ return net.neoforged.neoforge.common.util.RecipeMatcher.findMatches(nonEmptyItems, this.ingredients) != null;
} else {
return p_346123_.size() == 1 && this.ingredients.size() == 1
? this.ingredients.getFirst().test(p_346123_.getItem(0))
Expand Down

0 comments on commit 75c0a37

Please sign in to comment.