From e598ee5d08f630d8913b93cc97df86b421cfc58c Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Sat, 23 Nov 2024 20:37:38 +0100 Subject: [PATCH] Correctly mirror vanilla non-exact ingredients (#11651) --- .../Improve-exact-choice-recipe-ingredients.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/patches/server/Improve-exact-choice-recipe-ingredients.patch b/patches/server/Improve-exact-choice-recipe-ingredients.patch index 3dded9d251..3fa4d34759 100644 --- a/patches/server/Improve-exact-choice-recipe-ingredients.patch +++ b/patches/server/Improve-exact-choice-recipe-ingredients.patch @@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + int getMaxStackSize(); + -+ boolean is(ItemStack stack); ++ boolean matches(ItemStack stack); + + record Item(Holder item) implements ItemOrExact { + @@ -40,8 +40,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + @Override -+ public boolean is(final ItemStack stack) { -+ return stack.is(this.item); ++ public boolean matches(final ItemStack stack) { ++ return stack.is(this.item) && stack.getComponentsPatch().isEmpty(); + } + + @Override @@ -64,7 +64,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + @Override -+ public boolean is(final ItemStack stack) { ++ public boolean matches(final ItemStack stack) { + return ItemStack.isSameItemSameComponents(this.stack, stack); + } + @@ -209,7 +209,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ItemStack itemstack = (ItemStack) this.items.get(i); - if (!itemstack.isEmpty() && itemstack.is(item) && Inventory.isUsableForCrafting(itemstack)) { -+ if (!itemstack.isEmpty() && item.is(itemstack) && (!(item instanceof io.papermc.paper.inventory.recipe.ItemOrExact.Item) || isUsableForCrafting(itemstack))) { // Paper - Improve exact choice recipe ingredients ++ if (!itemstack.isEmpty() && item.matches(itemstack) && (!(item instanceof io.papermc.paper.inventory.recipe.ItemOrExact.Item) || isUsableForCrafting(itemstack))) { // Paper - Improve exact choice recipe ingredients return i; } }