craftbukkit/nms-patches/net/minecraft/world/item/crafting/RecipeItemStack.patch

27 lines
998 B
Diff
Raw Normal View History

2021-03-16 09:00:00 +11:00
--- a/net/minecraft/world/item/crafting/RecipeItemStack.java
+++ b/net/minecraft/world/item/crafting/RecipeItemStack.java
2024-04-24 01:15:00 +10:00
@@ -40,6 +40,7 @@
2021-06-11 15:00:00 +10:00
public ItemStack[] itemStacks;
2021-11-22 09:00:00 +11:00
@Nullable
2021-06-11 15:00:00 +10:00
private IntList stackingIds;
+ public boolean exact; // CraftBukkit
2023-09-22 02:40:00 +10:00
public static final Codec<RecipeItemStack> CODEC = codec(true);
public static final Codec<RecipeItemStack> CODEC_NONEMPTY = codec(false);
2024-04-24 01:15:00 +10:00
@@ -77,6 +78,15 @@
2022-12-08 03:00:00 +11:00
for (int j = 0; j < i; ++j) {
ItemStack itemstack1 = aitemstack[j];
2022-12-08 03:00:00 +11:00
+ // CraftBukkit start
+ if (exact) {
2024-04-24 01:15:00 +10:00
+ if (itemstack1.getItem() == itemstack.getItem() && ItemStack.isSameItemSameComponents(itemstack, itemstack1)) {
2022-12-08 03:00:00 +11:00
+ return true;
2020-06-25 10:00:00 +10:00
+ }
2022-12-08 03:00:00 +11:00
+
+ continue;
+ }
+ // CraftBukkit end
if (itemstack1.is(itemstack.getItem())) {
return true;
}