Paper/nms-patches/FurnaceRecipe.patch

35 lines
1.2 KiB
Diff
Raw Normal View History

2018-07-15 02:00:00 +02:00
--- a/net/minecraft/server/FurnaceRecipe.java
+++ b/net/minecraft/server/FurnaceRecipe.java
2019-04-23 04:00:00 +02:00
@@ -1,5 +1,16 @@
package net.minecraft.server;
2018-07-15 02:00:00 +02:00
+// CraftBukkit start
+import java.util.ArrayList;
+import java.util.List;
2018-07-15 02:00:00 +02:00
+import org.bukkit.craftbukkit.inventory.CraftFurnaceRecipe;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
2018-07-15 02:00:00 +02:00
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+import org.bukkit.inventory.Recipe;
+// CraftBukkit end
2019-04-23 04:00:00 +02:00
+
public class FurnaceRecipe extends RecipeCooking {
2018-07-15 02:00:00 +02:00
2019-04-23 04:00:00 +02:00
public FurnaceRecipe(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
@@ -10,4 +21,14 @@
public RecipeSerializer<?> getRecipeSerializer() {
return RecipeSerializer.o;
2018-07-15 02:00:00 +02:00
}
2019-04-23 04:00:00 +02:00
+
2018-07-15 02:00:00 +02:00
+ @Override
+ public Recipe toBukkitRecipe() {
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
+
+ CraftFurnaceRecipe recipe = new CraftFurnaceRecipe(CraftNamespacedKey.fromMinecraft(this.key), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
+ recipe.setGroup(this.group);
+
+ return recipe;
2018-07-15 02:00:00 +02:00
+ }
2019-04-23 04:00:00 +02:00
}