diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-01-19 20:42:25 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-01-19 20:42:25 +0100 |
commit | e4c3d799ffddb93c658062f9663ec027fc2f1d5a (patch) | |
tree | 5f2bca71f363d928dca2aa6d3bf92347476504f9 /src/Protocol/Protocol17x.cpp | |
parent | Changed SendBlockEntity format slightly (diff) | |
download | cuberite-e4c3d799ffddb93c658062f9663ec027fc2f1d5a.tar cuberite-e4c3d799ffddb93c658062f9663ec027fc2f1d5a.tar.gz cuberite-e4c3d799ffddb93c658062f9663ec027fc2f1d5a.tar.bz2 cuberite-e4c3d799ffddb93c658062f9663ec027fc2f1d5a.tar.lz cuberite-e4c3d799ffddb93c658062f9663ec027fc2f1d5a.tar.xz cuberite-e4c3d799ffddb93c658062f9663ec027fc2f1d5a.tar.zst cuberite-e4c3d799ffddb93c658062f9663ec027fc2f1d5a.zip |
Diffstat (limited to 'src/Protocol/Protocol17x.cpp')
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index c85641ca8..293f96186 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -893,13 +893,21 @@ void cProtocol172::SendUnloadChunk(int a_ChunkX, int a_ChunkZ) -void cProtocol172::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity) +void cProtocol172::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity) { cPacketizer Pkt(*this, 0x35); // Update tile entity packet - Pkt.WriteInt(a_BlockX); - Pkt.WriteShort(a_BlockY); - Pkt.WriteInt(a_BlockZ); - Pkt.WriteByte(a_Action); + Pkt.WriteInt(a_BlockEntity.GetPosX()); + Pkt.WriteShort(a_BlockEntity.GetPosY()); + Pkt.WriteInt(a_BlockEntity.GetPosZ()); + + Byte Action = 0; + switch (a_BlockEntity.GetBlockType()) + { + case E_BLOCK_MOB_SPAWNER: Action = 1; break; // Update mob spawner spinny mob thing + case E_BLOCK_COMMAND_BLOCK: Action = 2; break; // Update command block text + default: ASSERT(!"Unhandled or unimplemented BlockEntity update request!"); break; + } + Pkt.WriteByte(Action); Pkt.WriteBlockEntity(a_BlockEntity); } |