diff options
author | Mushroom Hostage <mushroomhostage@yahoo.com> | 2012-02-10 18:13:24 -0800 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-02-13 00:44:58 -0500 |
commit | 7076ef9de64e303f97915ec3e10494adb34a803f (patch) | |
tree | 78a40ea912633758bc53eaeaa24f705842b85b26 /src | |
parent | 1c28c946fa36623aeb5d341061438fe112fdf84e (diff) | |
download | craftbukkit-7076ef9de64e303f97915ec3e10494adb34a803f.tar craftbukkit-7076ef9de64e303f97915ec3e10494adb34a803f.tar.gz craftbukkit-7076ef9de64e303f97915ec3e10494adb34a803f.tar.lz craftbukkit-7076ef9de64e303f97915ec3e10494adb34a803f.tar.xz craftbukkit-7076ef9de64e303f97915ec3e10494adb34a803f.zip |
Use createNMSItemStack on CraftingManager recipe registration. Fixes BUKKIT-602
Diffstat (limited to 'src')
3 files changed, 3 insertions, 13 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java index 5b5e02d1..5afab7d8 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java @@ -24,11 +24,7 @@ public class CraftFurnaceRecipe extends FurnaceRecipe implements CraftRecipe { } public void addToCraftingManager() { - ItemStack result = this.getResult(); MaterialData input = this.getInput(); - int id = result.getTypeId(); - int amount = result.getAmount(); - int dmg = result.getDurability(); - FurnaceRecipes.getInstance().registerRecipe(input.getItemTypeId(), new net.minecraft.server.ItemStack(id, amount, dmg)); + FurnaceRecipes.getInstance().registerRecipe(input.getItemTypeId(), CraftItemStack.createNMSItemStack(this.getResult())); } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapedRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapedRecipe.java index ea63b33d..3af12516 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapedRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapedRecipe.java @@ -46,9 +46,6 @@ public class CraftShapedRecipe extends ShapedRecipe implements CraftRecipe { data[i] = new net.minecraft.server.ItemStack(id, 1, dmg); i++; } - int id = this.getResult().getTypeId(); - int amount = this.getResult().getAmount(); - short durability = this.getResult().getDurability(); - CraftingManager.getInstance().registerShapedRecipe(new net.minecraft.server.ItemStack(id, amount, durability), data); + CraftingManager.getInstance().registerShapedRecipe(CraftItemStack.createNMSItemStack(this.getResult()), data); } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java index d2f6d4cf..cef7187c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java @@ -34,9 +34,6 @@ public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe data[i] = new net.minecraft.server.ItemStack(id, 1, dmg); i++; } - int id = this.getResult().getTypeId(); - int amount = this.getResult().getAmount(); - short durability = this.getResult().getDurability(); - CraftingManager.getInstance().registerShapelessRecipe(new net.minecraft.server.ItemStack(id, amount, durability), data); + CraftingManager.getInstance().registerShapelessRecipe(CraftItemStack.createNMSItemStack(this.getResult()), data); } } |