summaryrefslogtreecommitdiffstats
path: root/src/ChunkSender.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-08-21 19:22:04 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-21 19:22:04 +0200
commita473e8ba52243a1a2a4f3aac840ed884d994fb0b (patch)
tree529ef1bcc101645ba31d269da8d398bb122a664b /src/ChunkSender.cpp
parentCompressPacket: reserve CompressedSize, not the uncompressed size (diff)
downloadcuberite-a473e8ba52243a1a2a4f3aac840ed884d994fb0b.tar
cuberite-a473e8ba52243a1a2a4f3aac840ed884d994fb0b.tar.gz
cuberite-a473e8ba52243a1a2a4f3aac840ed884d994fb0b.tar.bz2
cuberite-a473e8ba52243a1a2a4f3aac840ed884d994fb0b.tar.lz
cuberite-a473e8ba52243a1a2a4f3aac840ed884d994fb0b.tar.xz
cuberite-a473e8ba52243a1a2a4f3aac840ed884d994fb0b.tar.zst
cuberite-a473e8ba52243a1a2a4f3aac840ed884d994fb0b.zip
Diffstat (limited to 'src/ChunkSender.cpp')
-rw-r--r--src/ChunkSender.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/ChunkSender.cpp b/src/ChunkSender.cpp
index ec05258ae..e00b86795 100644
--- a/src/ChunkSender.cpp
+++ b/src/ChunkSender.cpp
@@ -11,7 +11,6 @@
#include "ChunkSender.h"
#include "World.h"
#include "BlockEntities/BlockEntity.h"
-#include "Protocol/ChunkDataSerializer.h"
#include "ClientHandle.h"
#include "Chunk.h"
@@ -61,7 +60,8 @@ public:
cChunkSender::cChunkSender(cWorld & a_World) :
Super("ChunkSender"),
- m_World(a_World)
+ m_World(a_World),
+ m_Serializer(m_World.GetDimension())
{
}
@@ -246,11 +246,8 @@ void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkZ, std::unordered_set<cCli
return;
}
- {
- // Send:
- cChunkDataSerializer Data(a_ChunkX, a_ChunkZ, m_Data, m_BiomeMap, m_World.GetDimension());
- Data.SendToClients(a_Clients);
- }
+ // Send:
+ m_Serializer.SendToClients(a_ChunkX, a_ChunkZ, m_Data, m_BiomeMap, a_Clients);
for (const auto Client : a_Clients)
{