PaperMC/paper-server/nms-patches/net/minecraft/world/item/crafting/RecipeHolder.patch
CraftBukkit/Spigot 8a3c8cfcd4 Update to Minecraft 1.20.2
By: md_5 <git@md-5.net>
2023-09-22 02:40:00 +10:00

20 lines
697 B
Diff

--- 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) {