diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-24 09:58:26 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-24 09:58:26 +0200 |
commit | e92b9e7ecbdf2918aab59d4eeb7bb5966430b264 (patch) | |
tree | 1a998d44e5faab91c54ea8517dd9fa02b3732ef7 /source/ChunkSender.cpp | |
parent | Added plugin name to deprecation messages (diff) | |
download | cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.gz cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.bz2 cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.lz cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.xz cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.zst cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.zip |
Diffstat (limited to 'source/ChunkSender.cpp')
-rw-r--r-- | source/ChunkSender.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/source/ChunkSender.cpp b/source/ChunkSender.cpp index e88ed6f31..cefc6458f 100644 --- a/source/ChunkSender.cpp +++ b/source/ChunkSender.cpp @@ -237,20 +237,21 @@ void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cClientHa a_Client->Send(MapChunk); } - // Send entity creation packets: - for (PacketList::iterator itr = m_Packets.begin(); itr != m_Packets.end(); ++itr) + // Send block-entity packets: + for (sBlockCoords::iterator itr = m_BlockEntities.begin(); itr != m_BlockEntities.end(); ++itr) { if (a_Client == NULL) { - m_World->BroadcastToChunk(a_ChunkX, a_ChunkY, a_ChunkZ, **itr); + m_World->BroadcastBlockEntity(itr->m_BlockX, itr->m_BlockY, itr->m_BlockZ); } else { - a_Client->Send(**itr); + m_World->SendBlockEntity(itr->m_BlockX, itr->m_BlockY, itr->m_BlockZ, *a_Client); } - delete *itr; } // for itr - m_Packets[] - m_Packets.clear(); + m_BlockEntities.clear(); + + // TODO: Send entity spawn packets } @@ -259,11 +260,7 @@ void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cClientHa void cChunkSender::BlockEntity(cBlockEntity * a_Entity) { - cPacket * Packet = a_Entity->GetPacket(); - if (Packet != NULL) - { - m_Packets.push_back(Packet); - } + m_BlockEntities.push_back(sBlockCoord(a_Entity->GetPosX(), a_Entity->GetPosY(), a_Entity->GetPosZ())); } |