You have a giant bug in the cPacket_CreateInventoryAction packet.
This totals 11 bytes, while the protcol documentation says it's 9 bytes (which makes sense: 4 shorts (8bytes) + packet id (1byte) = 9bytes)
I'm still looking at the other changes you made
---------
Should be m_Damage;
--------
Make sure this is true for this packet, minecraft is not consistent with this. Sometimes empty is 0, and sometimes it's -1, the client WILL crash if it's wrong
--------
You made some unnecessary changes to cPlugin.h, cInventory.h and Bindings.cpp.
cPlugin.h and cInventory.h both have some classes Forward declared, you only have to do that when you actually use the classes (in this case you're not using cPacket_CreateInventoryAction in those files)
Bindings.cpp is automagically generated by "trunk/source/AllToLua.bat", it's a windows executable that reads several *.h files and creates Lua bindings.
--------
You added
to cPacket.h, this is not the right place for this, and packets should not be initialized with a gamemode. I suggest moving this to the cWorld class, and reading the gamemode from cWorld while filling in a packet before sending it.
For example:
Same goes for the login packet
--------
Since players might want to switch to creative/survival mode on the fly, GAMEMODE should not be a constant value in cClientHandle, just make it a regular int m_GameMode (in cClientHandle OR cPlayer) and initialize it to the current cWorld value (see above) then when a player decides to change game mode, just switch the integer to 0 or 1
(I see you moved it to one spot, but above still applies, and it should actually be in 2 places)
Code:
static const unsigned int c_Size = 1 + 4 + 2 + 2 + 2;
I'm still looking at the other changes you made
---------
Code:
short m_Short;
--------
Code:
if( m_ItemID <= 0 ) m_ItemID = -1; // Fix, to make sure no invalid values are sent.
// WARNING: HERE ITS -1, BUT IN NAMED ENTITY SPAWN PACKET ITS 0 !!
--------
You made some unnecessary changes to cPlugin.h, cInventory.h and Bindings.cpp.
cPlugin.h and cInventory.h both have some classes Forward declared, you only have to do that when you actually use the classes (in this case you're not using cPacket_CreateInventoryAction in those files)
Bindings.cpp is automagically generated by "trunk/source/AllToLua.bat", it's a windows executable that reads several *.h files and creates Lua bindings.
--------
You added
Code:
static const int GAMEMODE = 1; //0 = Survival, 1 = Creative;
For example:
Code:
// Create Respawn player packet
cPacket_Respawn Packet;
Packet.m_CreativeMode = cRoot::Get()->GetWorld()->GetGameMode();
// .. fill in some more stuff
// Send packet
// ???
// profit
--------
Since players might want to switch to creative/survival mode on the fly, GAMEMODE should not be a constant value in cClientHandle, just make it a regular int m_GameMode (in cClientHandle OR cPlayer) and initialize it to the current cWorld value (see above) then when a player decides to change game mode, just switch the integer to 0 or 1
(I see you moved it to one spot, but above still applies, and it should actually be in 2 places)