diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-26 23:01:07 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-26 23:01:07 +0200 |
commit | d97ad781b4ea1998b9819f139c7ab7806161042e (patch) | |
tree | 84f8b2e37bb141b7ef57e34385ab0be7b7dc60d2 /source/ChunkSender.cpp | |
parent | Turned a common assert into a warning log (diff) | |
download | cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.tar cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.tar.gz cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.tar.bz2 cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.tar.lz cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.tar.xz cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.tar.zst cuberite-d97ad781b4ea1998b9819f139c7ab7806161042e.zip |
Diffstat (limited to '')
-rw-r--r-- | source/ChunkSender.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source/ChunkSender.cpp b/source/ChunkSender.cpp index cefc6458f..25fb94e17 100644 --- a/source/ChunkSender.cpp +++ b/source/ChunkSender.cpp @@ -10,9 +10,8 @@ #include "Globals.h" #include "ChunkSender.h" #include "cWorld.h" -#include "packets/cPacket_MapChunk.h" -#include "packets/cPacket_PreChunk.h" #include "cBlockEntity.h" +#include "ChunkDataSerializer.h" @@ -217,24 +216,21 @@ void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cClientHa return; } - // Prepare MapChunk packets: + // Query and prepare chunk data: if( !m_World->GetChunkData(a_ChunkX, a_ChunkY, a_ChunkZ, *this) ) { return; } - cPacket_PreChunk PreChunk(a_ChunkX, a_ChunkZ, true); - cPacket_MapChunk MapChunk(a_ChunkX, a_ChunkY, a_ChunkZ, (BLOCKTYPE *)m_BlockData, m_BiomeMap); + cChunkDataSerializer Data(m_BlockTypes, m_BlockMetas, m_BlockLight, m_BlockSkyLight, m_BiomeMap); // Send: if (a_Client == NULL) { - m_World->BroadcastToChunk(a_ChunkX, a_ChunkY, a_ChunkZ, PreChunk); - m_World->BroadcastToChunk(a_ChunkX, a_ChunkY, a_ChunkZ, MapChunk); + m_World->BroadcastChunkData(a_ChunkX, a_ChunkZ, Data); } else { - a_Client->Send(PreChunk); - a_Client->Send(MapChunk); + a_Client->SendChunkData(a_ChunkX, a_ChunkZ, Data); } // Send block-entity packets: |