aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/world/item/crafting/RecipeHolder.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/item/crafting/RecipeHolder.java.patch')
-rw-r--r--patch-remap/mache-spigotflower/net/minecraft/world/item/crafting/RecipeHolder.java.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/item/crafting/RecipeHolder.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/item/crafting/RecipeHolder.java.patch
new file mode 100644
index 0000000000..16a1050265
--- /dev/null
+++ b/patch-remap/mache-spigotflower/net/minecraft/world/item/crafting/RecipeHolder.java.patch
@@ -0,0 +1,35 @@
+--- a/net/minecraft/world/item/crafting/RecipeHolder.java
++++ b/net/minecraft/world/item/crafting/RecipeHolder.java
+@@ -1,10 +1,17 @@
+ 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) {
++public record RecipeHolder<T extends net.minecraft.world.item.crafting.Recipe<?>>(ResourceLocation id, T value) {
+
+- @Override
++ public final Recipe toBukkitRecipe() {
++ return this.value.toBukkitRecipe(CraftNamespacedKey.fromMinecraft(this.id));
++ }
++ // CraftBukkit end
++
+ public boolean equals(Object object) {
+ if (this == object) {
+ return true;
+@@ -25,12 +32,10 @@
+ }
+ }
+
+- @Override
+ public int hashCode() {
+ return this.id.hashCode();
+ }
+
+- @Override
+ public String toString() {
+ return this.id.toString();
+ }