mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Correctly mirror vanilla non-exact ingredients (#11651)
This commit is contained in:
parent
0dc6316e04
commit
e598ee5d08
1 changed files with 5 additions and 5 deletions
|
@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
+ int getMaxStackSize();
|
||||
+
|
||||
+ boolean is(ItemStack stack);
|
||||
+ boolean matches(ItemStack stack);
|
||||
+
|
||||
+ record Item(Holder<net.minecraft.world.item.Item> 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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue