This sets the stack size for the specified item to whatever stewStackSize is. So replace stewStackSize with whatever you want the stack size to be (no greater than 64).
If I was to release an updated version of the Stackable Stews mod, I would make them stack to 64. I played a bit with a stack size of 16 and it was still barely worth carrying them around. 64 puts them more on par with other foods.
If you want to change the stack size of other items as well, you can add additional lines like the ones above, replacing the item's variable name with the item you want to change. A full list of the correct item variable names can be found in the Items class in the forge source library.
But... be aware that some items may behave oddly if you adjust thier stack size. This is the case with stews. They are intended to be single-use items that are replaced with an empty bowl after use, so when one is used it will replace the entire stack with an empty bowl regardless of how many are in the stack. Not what we want!
So... we need to use a forge hook to bypass this behaviour and make it only replace the stack with an empty bowl when the stack is empty (it's actually reasonably simple to do this).
Bypassing The Default Stew Stack Behaviour Using a Forge Hook:
Jabelar kindly posted a detailed wirteup on Event Handling here. Check it out for an overview of forge hooks if you're not familiar.
Then create a new class called PlayerUseItemHandler (or whatever you want to call it, so long as it matches the name in the registration method above) and put the following code into that class:
public void onUseFinish(PlayerUseItemEvent.Finish event)
ItemStack itemstack = event.item;
EntityPlayer player = event.entityPlayer;
if(itemstack.getItem() == Items.mushroom_stew || itemstack.getItem() == Items.rabbit_stew)
if (itemstack.stackSize <= 0)
event.result = new ItemStack(Items.bowl);
event.result = itemstack;
This tells Minecraft to only replace the stack with an empty bowl if the stack size is <= 0. Otherwise, it places an empty bowl in an empty slot in your inventory instead.
If you want to make this work with other types of stews, you need to add another condition in the first if statement for each type of stew you are adding. For instance: itemstack.getItem() == Items.beet_stew
Again, you will need to look up the correct variable name in the Items class.
This works like a charm in 1.8, but it may require some changes to work with other versions and with new types of stews (that's for you to test and figure out). If the new stews use the ItemSoup class everything should work fine.
I'm sure there are many other ways to put this code together that would work just as well, if not better. This is just one way to do it.
If you have any questions feel free to ask. However, know that I know nothing about how Minecraft 1.8 is different from any other version. I've only ever modded 1.8.
I hope someone uses this information to make a Stackable Stews mods for other versions of Minecraft. Stews are pretty much useless if they don't stack and it would be nice if everyone could have useful stews.