Skip to content

Commit

Permalink
fix ct ingredient size mismatch causing recipe lookup failure (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
PrototypeTrousers authored Nov 3, 2022
1 parent fced14c commit ef2eaf4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ public boolean acceptsStack(@Nullable ItemStack itemStack) {
IItemStack[] itemArray = this.ingredient.getItemArray();
if (itemArray.length == 0) return true;

return ingredient.getItems().stream().anyMatch(ii -> ii.matches(CraftTweakerMC.getIItemStackForMatching(itemStack, ii.getMetadata() == GTValues.W)));
return ingredient.getItems().stream().anyMatch(ii -> {
if (ii.getAmount() > itemStack.getCount()) {
final ItemStack is = itemStack.copy();
is.setCount(ii.getAmount());
return ii.matches(CraftTweakerMC.getIItemStackForMatching(is, ii.getMetadata() == GTValues.W));
}
return ii.matches(CraftTweakerMC.getIItemStackForMatching(itemStack, ii.getMetadata() == GTValues.W));
});
}

@Override
Expand Down

0 comments on commit ef2eaf4

Please sign in to comment.