mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
65bc2541a3
By: md_5 <git@md-5.net>
22 lines
906 B
Diff
22 lines
906 B
Diff
--- a/net/minecraft/world/item/crafting/RecipeHolder.java
|
|
+++ b/net/minecraft/world/item/crafting/RecipeHolder.java
|
|
@@ -4,8 +4,19 @@
|
|
import net.minecraft.network.codec.StreamCodec;
|
|
import net.minecraft.resources.MinecraftKey;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
|
+import org.bukkit.inventory.Recipe;
|
|
+// CraftBukkit end
|
|
+
|
|
public record RecipeHolder<T extends IRecipe<?>>(MinecraftKey id, T value) {
|
|
|
|
+ // CraftBukkit start
|
|
+ public final Recipe toBukkitRecipe() {
|
|
+ return this.value.toBukkitRecipe(CraftNamespacedKey.fromMinecraft(this.id));
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
public static final StreamCodec<RegistryFriendlyByteBuf, RecipeHolder<?>> STREAM_CODEC = StreamCodec.composite(MinecraftKey.STREAM_CODEC, RecipeHolder::id, IRecipe.STREAM_CODEC, RecipeHolder::value, RecipeHolder::new);
|
|
|
|
public boolean equals(Object object) {
|