aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/item/crafting/RecipeHolder.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/item/crafting/RecipeHolder.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/item/crafting/RecipeHolder.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/item/crafting/RecipeHolder.patch b/patch-remap/og/net/minecraft/world/item/crafting/RecipeHolder.patch
new file mode 100644
index 0000000000..980b0b897b
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/item/crafting/RecipeHolder.patch
@@ -0,0 +1,20 @@
+--- a/net/minecraft/world/item/crafting/RecipeHolder.java
++++ b/net/minecraft/world/item/crafting/RecipeHolder.java
+@@ -2,7 +2,16 @@
+
+ import net.minecraft.resources.MinecraftKey;
+
+-public record RecipeHolder<T extends IRecipe<?>> (MinecraftKey id, T value) {
++// CraftBukkit start
++import org.bukkit.craftbukkit.util.CraftNamespacedKey;
++import org.bukkit.inventory.Recipe;
++
++public record RecipeHolder<T extends IRecipe<?>>(MinecraftKey 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) {