Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/nms-patches/RecipeStonecutting.patch

34 Zeilen
1.2 KiB
Diff

2019-04-23 04:00:00 +02:00
--- a/net/minecraft/server/RecipeStonecutting.java
+++ b/net/minecraft/server/RecipeStonecutting.java
@@ -1,5 +1,13 @@
package net.minecraft.server;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
+import org.bukkit.craftbukkit.inventory.CraftStonecuttingRecipe;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+import org.bukkit.inventory.Recipe;
+// CraftBukkit end
+
public class RecipeStonecutting extends RecipeSingleItem {
public RecipeStonecutting(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack) {
@@ -10,4 +18,16 @@
public boolean a(IInventory iinventory, World world) {
return this.ingredient.test(iinventory.getItem(0));
}
+
+ // CraftBukkit start
+ @Override
+ public Recipe toBukkitRecipe() {
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
+
+ CraftStonecuttingRecipe recipe = new CraftStonecuttingRecipe(CraftNamespacedKey.fromMinecraft(this.key), result, CraftRecipe.toBukkit(this.ingredient));
+ recipe.setGroup(this.group);
+
+ return recipe;
+ }
+ // CraftBukkit end
}