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

36 lines
1.4 KiB
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
@@ -35,6 +35,7 @@
2021-06-11 15:00:00 +10:00
private final RecipeItemStack.Provider[] values;
public ItemStack[] itemStacks;
private IntList stackingIds;
+ public boolean exact; // CraftBukkit
public RecipeItemStack(Stream<? extends RecipeItemStack.Provider> stream) {
2021-06-11 15:00:00 +10:00
this.values = (RecipeItemStack.Provider[]) stream.toArray((i) -> {
@@ -72,6 +73,15 @@
2020-06-25 10:00:00 +10:00
for (int j = 0; j < i; ++j) {
ItemStack itemstack1 = aitemstack[j];
2020-06-25 10:00:00 +10:00
+ // CraftBukkit start
+ if (exact) {
+ if (itemstack1.getItem() == itemstack.getItem() && ItemStack.equals(itemstack, itemstack1)) {
+ return true;
+ }
+
2020-06-25 10:00:00 +10:00
+ continue;
+ }
+ // CraftBukkit end
2021-06-11 15:00:00 +10:00
if (itemstack1.a(itemstack.getItem())) {
2020-06-25 10:00:00 +10:00
return true;
}
2021-06-11 15:00:00 +10:00
@@ -103,7 +113,7 @@
public void a(PacketDataSerializer packetdataserializer) {
this.buildChoices();
- packetdataserializer.a((Collection) Arrays.asList(this.itemStacks), PacketDataSerializer::a);
+ packetdataserializer.a(Arrays.asList(this.itemStacks), PacketDataSerializer::a); // CraftBukkit - decompile error
}
public JsonElement c() {