From 24557bc2b37deb6a0edf497d547471832457b1dd Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 26 Nov 2014 08:32:16 +1100 Subject: Update to Minecraft 1.8 For more information please see http://www.spigotmc.org/ --- nms-patches/ShapedRecipes.patch | 77 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 nms-patches/ShapedRecipes.patch (limited to 'nms-patches/ShapedRecipes.patch') diff --git a/nms-patches/ShapedRecipes.patch b/nms-patches/ShapedRecipes.patch new file mode 100644 index 00000000..5b3908ce --- /dev/null +++ b/nms-patches/ShapedRecipes.patch @@ -0,0 +1,77 @@ +--- ../work/decompile-bb26c12b/net/minecraft/server/ShapedRecipes.java 2014-11-27 08:59:46.889421019 +1100 ++++ src/main/java/net/minecraft/server/ShapedRecipes.java 2014-11-27 08:42:10.164850887 +1100 +@@ -1,5 +1,11 @@ + package net.minecraft.server; + ++// CraftBukkit start ++import org.bukkit.craftbukkit.inventory.CraftItemStack; ++import org.bukkit.craftbukkit.inventory.CraftShapedRecipe; ++// CraftBukkit end ++ ++ + public class ShapedRecipes implements IRecipe { + + private final int width; +@@ -14,6 +20,62 @@ + this.items = aitemstack; + this.result = itemstack; + } ++ ++ // CraftBukkit start ++ public org.bukkit.inventory.ShapedRecipe toBukkitRecipe() { ++ CraftItemStack result = CraftItemStack.asCraftMirror(this.result); ++ CraftShapedRecipe recipe = new CraftShapedRecipe(result, this); ++ switch (this.height) { ++ case 1: ++ switch (this.width) { ++ case 1: ++ recipe.shape("a"); ++ break; ++ case 2: ++ recipe.shape("ab"); ++ break; ++ case 3: ++ recipe.shape("abc"); ++ break; ++ } ++ break; ++ case 2: ++ switch (this.width) { ++ case 1: ++ recipe.shape("a","b"); ++ break; ++ case 2: ++ recipe.shape("ab","cd"); ++ break; ++ case 3: ++ recipe.shape("abc","def"); ++ break; ++ } ++ break; ++ case 3: ++ switch (this.width) { ++ case 1: ++ recipe.shape("a","b","c"); ++ break; ++ case 2: ++ recipe.shape("ab","cd","ef"); ++ break; ++ case 3: ++ recipe.shape("abc","def","ghi"); ++ break; ++ } ++ break; ++ } ++ char c = 'a'; ++ for (ItemStack stack : this.items) { ++ if (stack != null) { ++ recipe.setIngredient(c, org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(stack.getItem()), stack.getData()); ++ } ++ c++; ++ } ++ return recipe; ++ } ++ // CraftBukkit end + + public ItemStack b() { + return this.result; -- cgit v1.2.3