2023-09-21 18:40:00 +02:00
|
|
|
--- a/net/minecraft/world/item/crafting/RecipeHolder.java
|
|
|
|
+++ b/net/minecraft/world/item/crafting/RecipeHolder.java
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -4,8 +4,19 @@
|
|
|
|
import net.minecraft.network.codec.StreamCodec;
|
2023-09-21 18:40:00 +02:00
|
|
|
import net.minecraft.resources.MinecraftKey;
|
|
|
|
|
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
|
|
|
+import org.bukkit.inventory.Recipe;
|
2024-04-23 17:15:00 +02:00
|
|
|
+// CraftBukkit end
|
2023-09-21 18:40:00 +02:00
|
|
|
+
|
2024-04-23 17:15:00 +02:00
|
|
|
public record RecipeHolder<T extends IRecipe<?>>(MinecraftKey id, T value) {
|
|
|
|
|
|
|
|
+ // CraftBukkit start
|
2023-09-21 18:40:00 +02:00
|
|
|
+ public final Recipe toBukkitRecipe() {
|
|
|
|
+ return this.value.toBukkitRecipe(CraftNamespacedKey.fromMinecraft(this.id));
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2024-04-23 17:15:00 +02:00
|
|
|
+
|
|
|
|
public static final StreamCodec<RegistryFriendlyByteBuf, RecipeHolder<?>> STREAM_CODEC = StreamCodec.composite(MinecraftKey.STREAM_CODEC, RecipeHolder::id, IRecipe.STREAM_CODEC, RecipeHolder::value, RecipeHolder::new);
|
2023-09-21 18:40:00 +02:00
|
|
|
|
|
|
|
public boolean equals(Object object) {
|