mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 13:21:24 +01:00
Correctly mirror vanilla non-exact ingredients (#11651)
This commit is contained in:
parent
0dc6316e04
commit
e598ee5d08
@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+
|
+
|
||||||
+ int getMaxStackSize();
|
+ int getMaxStackSize();
|
||||||
+
|
+
|
||||||
+ boolean is(ItemStack stack);
|
+ boolean matches(ItemStack stack);
|
||||||
+
|
+
|
||||||
+ record Item(Holder<net.minecraft.world.item.Item> item) implements ItemOrExact {
|
+ record Item(Holder<net.minecraft.world.item.Item> item) implements ItemOrExact {
|
||||||
+
|
+
|
||||||
@ -40,8 +40,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean is(final ItemStack stack) {
|
+ public boolean matches(final ItemStack stack) {
|
||||||
+ return stack.is(this.item);
|
+ return stack.is(this.item) && stack.getComponentsPatch().isEmpty();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
@ -64,7 +64,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean is(final ItemStack stack) {
|
+ public boolean matches(final ItemStack stack) {
|
||||||
+ return ItemStack.isSameItemSameComponents(this.stack, stack);
|
+ return ItemStack.isSameItemSameComponents(this.stack, stack);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -209,7 +209,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
ItemStack itemstack = (ItemStack) this.items.get(i);
|
ItemStack itemstack = (ItemStack) this.items.get(i);
|
||||||
|
|
||||||
- if (!itemstack.isEmpty() && itemstack.is(item) && Inventory.isUsableForCrafting(itemstack)) {
|
- 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;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user