0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git synced 2024-11-22 11:16:17 +00:00
craftbukkit/nms-patches/net/minecraft/world/item/crafting/TransmuteRecipe.patch
2024-10-23 02:15:00 +11:00

32 lines
1.2 KiB
Diff

--- a/net/minecraft/world/item/crafting/TransmuteRecipe.java
+++ b/net/minecraft/world/item/crafting/TransmuteRecipe.java
@@ -20,6 +20,14 @@
import net.minecraft.world.level.IMaterial;
import net.minecraft.world.level.World;
+// CraftBukkit start
+import org.bukkit.NamespacedKey;
+import org.bukkit.craftbukkit.inventory.CraftItemType;
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
+import org.bukkit.craftbukkit.inventory.CraftTransmuteRecipe;
+import org.bukkit.inventory.Recipe;
+// CraftBukkit end
+
public class TransmuteRecipe implements RecipeCrafting {
final String group;
@@ -84,6 +92,13 @@
return List.of(new ShapelessCraftingRecipeDisplay(List.of(this.input.display(), this.material.display()), new SlotDisplay.d(this.result), new SlotDisplay.d(Items.CRAFTING_TABLE)));
}
+ // CraftBukkit start
+ @Override
+ public Recipe toBukkitRecipe(NamespacedKey id) {
+ return new CraftTransmuteRecipe(id, CraftItemType.minecraftToBukkit(this.result.value()), CraftRecipe.toBukkit(this.input), CraftRecipe.toBukkit(this.material));
+ }
+ // CraftBukkit end
+
@Override
public RecipeSerializer<TransmuteRecipe> getSerializer() {
return RecipeSerializer.TRANSMUTE;