1
0

Initial implementation of explosions and TNT block

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1392 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
keyboard.osh@gmail.com
2013-04-18 02:42:45 +00:00
parent a4be800a91
commit b75fc5f4e8
17 changed files with 266 additions and 2 deletions

View File

@@ -352,6 +352,34 @@ void cProtocol125::SendEntityStatus(const cEntity & a_Entity, char a_Status)
void cProtocol125::SendExplosion(double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, cVector3iList a_BlocksAffected, float a_PlayerMotionX, float a_PlayerMotionY, float a_PlayerMotionZ)
{
cCSLock Lock(m_CSPacket);
WriteByte(PACKET_EXPLOSION);
WriteDouble (a_BlockX);
WriteDouble (a_BlockY);
WriteDouble (a_BlockZ);
WriteFloat (a_Radius);
WriteInt (a_BlocksAffected.size());//it should be a_RecordCount
/*WriteByte (0); //It should be the record
WriteByte (0);
WriteByte (0);*/
for (cVector3iList::iterator itr = a_BlocksAffected.begin(); itr != a_BlocksAffected.end(); ++itr)
{
WriteByte ((Byte)((*itr)->x - a_BlockX));
WriteByte ((Byte)((*itr)->y - a_BlockY));
WriteByte ((Byte)((*itr)->z - a_BlockZ));
}
WriteFloat (a_PlayerMotionX);
WriteFloat (a_PlayerMotionY);
WriteFloat (a_PlayerMotionZ);
Flush();
}
void cProtocol125::SendEntRelMove(const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ)
{
ASSERT(a_Entity.GetUniqueID() != m_Client->GetPlayer()->GetUniqueID()); // Must not send for self