mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
8a3c8cfcd4
By: md_5 <git@md-5.net>
21 lines
697 B
Diff
21 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) {
|