diff options
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/item/crafting/RecipeHolder.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower/net/minecraft/world/item/crafting/RecipeHolder.java.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/item/crafting/RecipeHolder.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/item/crafting/RecipeHolder.java.patch new file mode 100644 index 0000000000..b9dcb13846 --- /dev/null +++ b/patch-remap/mache-vineflower/net/minecraft/world/item/crafting/RecipeHolder.java.patch @@ -0,0 +1,51 @@ +--- a/net/minecraft/world/item/crafting/RecipeHolder.java ++++ b/net/minecraft/world/item/crafting/RecipeHolder.java +@@ -1,27 +1,41 @@ + package net.minecraft.world.item.crafting; + + import net.minecraft.resources.ResourceLocation; ++// CraftBukkit start ++import org.bukkit.craftbukkit.util.CraftNamespacedKey; ++import org.bukkit.inventory.Recipe; + +-public record RecipeHolder<T extends Recipe<?>>(ResourceLocation id, T value) { +- @Override ++public record RecipeHolder<T extends net.minecraft.world.item.crafting.Recipe<?>>(ResourceLocation id, T value) { ++ ++ public final Recipe toBukkitRecipe() { ++ return this.value.toBukkitRecipe(CraftNamespacedKey.fromMinecraft(this.id)); ++ } ++ // CraftBukkit end ++ + public boolean equals(Object object) { + if (this == object) { + return true; + } else { +- if (object instanceof RecipeHolder<?> recipeHolder && this.id.equals(recipeHolder.id)) { +- return true; ++ boolean flag; ++ ++ if (object instanceof RecipeHolder) { ++ RecipeHolder<?> recipeholder = (RecipeHolder) object; ++ ++ if (this.id.equals(recipeholder.id)) { ++ flag = true; ++ return flag; ++ } + } + +- return false; ++ flag = false; ++ return flag; + } + } + +- @Override + public int hashCode() { + return this.id.hashCode(); + } + +- @Override + public String toString() { + return this.id.toString(); + } |