Cuberite Forum
Max item stack - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Max item stack (/thread-458.html)



Max item stack - Taugeshtu - 06-01-2012

Okay, I've looked through sources this timeBig Grin But the only mention of stack was found in cInventory.cpp, and it was like:
Code:
bool cInventory::AddToBar( cItem & a_Item, const int a_Offset, const int a_Size, bool* a_bChangedSlots, int a_Mode /* = 0 */ )
{
    // Fill already present stacks
    if( a_Mode < 2 )
    {
        for(int i = 0; i < a_Size; i++)
        {
            if( m_Slots[i + a_Offset].m_ItemID == a_Item.m_ItemID && m_Slots[i + a_Offset].m_ItemCount < 64 && m_Slots[i + a_Offset].m_ItemHealth == a_Item.m_ItemHealth )
            {
                int NumFree = 64 - m_Slots[i + a_Offset].m_ItemCount;
                if( NumFree >= a_Item.m_ItemCount )
                {
In other words - seems like max item stack is hard-coded. Can't find any .ini or plugin access to it.

Question is: could it be done? I would greatly appretiate it (even more, than wolves!), because I'm willing to make REALLY different server Smile With a maximum stack of any item = 8 Smile (I know, this sounds like a mess, but I know what I'm doing there)
How about section [StackSize] in items.ini?


RE: Max item stack - FakeTruth - 06-01-2012

Stack sizes are simulated on the client, so if you set the max stack size on the server to 8 you'll get some nasty bugs that make you unable to use the inventory properly.

You can already see this when you try to stack tools (I think MCServer allows stacking of tools, but the client doesn't)