From 5e1949eb0e3a43d3ec6c710289532d93f6819934 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 23 Mar 2013 14:58:25 -0400 Subject: [PATCH] Clone the itemstack, and allow for passing in a stacksize --- common/cpw/mods/fml/common/registry/GameData.java | 2 +- common/cpw/mods/fml/common/registry/GameRegistry.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/cpw/mods/fml/common/registry/GameData.java b/common/cpw/mods/fml/common/registry/GameData.java index 0eeb164d4f..aeb74ce130 100644 --- a/common/cpw/mods/fml/common/registry/GameData.java +++ b/common/cpw/mods/fml/common/registry/GameData.java @@ -319,7 +319,7 @@ public class GameData { Block b = findBlock(modId, name); if (b != null) { - is = new ItemStack(b, 0, 0); + is = new ItemStack(b, 0, Short.MAX_VALUE); } } return is; diff --git a/common/cpw/mods/fml/common/registry/GameRegistry.java b/common/cpw/mods/fml/common/registry/GameRegistry.java index 2333cc7033..7f95c2dfa6 100644 --- a/common/cpw/mods/fml/common/registry/GameRegistry.java +++ b/common/cpw/mods/fml/common/registry/GameRegistry.java @@ -411,10 +411,13 @@ public class GameRegistry * * @param modId The modid of the stack owner * @param name The name of the stack + * @param stackSize The size of the stack returned * @return The custom itemstack or null if no such itemstack was found */ - public static ItemStack findItemStack(String modId, String name) + public static ItemStack findItemStack(String modId, String name, int stackSize) { - return GameData.findItemStack(modId, name); + ItemStack is = GameData.findItemStack(modId, name).func_77946_l(); + is.field_77994_a = stackSize; + return is; } }