mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 08:44:25 +00:00
Validate supplied stack size
This commit is contained in:
1 parent
5e1949eb0e
commit
ede93d438f
1 file changed
+3
-1
@@ -409,6 +409,8 @@ public class GameRegistry
|
||||
* Lookup an itemstack based on mod and name. It will create "default" itemstacks from blocks and items if no
|
||||
* explicit itemstack is found.
|
||||
*
|
||||
* If it is built from a block, the metadata is by default the "wildcard" value.
|
||||
*
|
||||
* @param modId The modid of the stack owner
|
||||
* @param name The name of the stack
|
||||
* @param stackSize The size of the stack returned
|
||||
@@ -417,7 +419,7 @@ public class GameRegistry
|
||||
public static ItemStack findItemStack(String modId, String name, int stackSize)
|
||||
{
|
||||
ItemStack is = GameData.findItemStack(modId, name).func_77946_l();
|
||||
is.field_77994_a = stackSize;
|
||||
is.field_77994_a = Math.min(stackSize, is.func_77976_d());
|
||||
return is;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user