diff options
Diffstat (limited to 'nms-patches/ShapedRecipes.patch')
-rw-r--r-- | nms-patches/ShapedRecipes.patch | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/nms-patches/ShapedRecipes.patch b/nms-patches/ShapedRecipes.patch index 9f7c4969..b86fd148 100644 --- a/nms-patches/ShapedRecipes.patch +++ b/nms-patches/ShapedRecipes.patch @@ -1,17 +1,17 @@ --- a/net/minecraft/server/ShapedRecipes.java +++ b/net/minecraft/server/ShapedRecipes.java -@@ -1,5 +1,10 @@ - package net.minecraft.server; - +@@ -12,6 +12,10 @@ + import java.util.Map; + import java.util.Map.Entry; + import javax.annotation.Nullable; +// 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; -@@ -22,6 +27,62 @@ + public class ShapedRecipes extends IRecipe { + +@@ -28,6 +32,63 @@ this.result = itemstack; } @@ -61,8 +61,9 @@ + break; + } + char c = 'a'; -+ for (ItemStack stack : this.items) { -+ if (stack != null) { ++ for (RecipeItemStack list : this.items) { ++ if (list != null && list.choices.length > 0) { ++ net.minecraft.server.ItemStack stack = list.choices[0]; + recipe.setIngredient(c, org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(stack.getItem()), stack.getData()); + } + c++; |