PaperMC/paper-server/nms-patches/net/minecraft/world/item/crafting/FurnaceRecipe.patch

33 lines
1.2 KiB
Diff
Raw Normal View History

2021-03-15 23:00:00 +01:00
--- a/net/minecraft/world/item/crafting/FurnaceRecipe.java
+++ b/net/minecraft/world/item/crafting/FurnaceRecipe.java
@@ -4,6 +4,14 @@
2021-03-15 23:00:00 +01:00
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Blocks;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftFurnaceRecipe;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+import org.bukkit.inventory.Recipe;
+// CraftBukkit end
+
public class FurnaceRecipe extends RecipeCooking {
public FurnaceRecipe(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
@@ -19,4 +27,14 @@
public RecipeSerializer<?> getRecipeSerializer() {
return RecipeSerializer.SMELTING_RECIPE;
}
+
+ @Override
+ public Recipe toBukkitRecipe() {
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
+
+ CraftFurnaceRecipe recipe = new CraftFurnaceRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
+ recipe.setGroup(this.group);
+
+ return recipe;
+ }
}