diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-03-28 15:44:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-28 15:44:20 +0200 |
commit | 2687f2df30210ada485c28c98e52db08d460d5a3 (patch) | |
tree | d0b25a9c996c1dd72e3ed4840dded5e8642d4342 /src/ChunkMap.cpp | |
parent | Do not fake a tool when converting to pickups (#5170) (diff) | |
download | cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.tar cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.tar.gz cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.tar.bz2 cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.tar.lz cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.tar.xz cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.tar.zst cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ChunkMap.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 7bdd1c649..669a4f564 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -1339,10 +1339,18 @@ void cChunkMap::SpawnMobs(cMobSpawner & a_MobSpawner) void cChunkMap::Tick(std::chrono::milliseconds a_Dt) { cCSLock Lock(m_CSChunks); + + // Do the magic of updating the world: for (auto & Chunk : m_Chunks) { Chunk.second.Tick(a_Dt); } + + // Finally, only after all chunks are ticked, tell the client about all aggregated changes: + for (auto & Chunk : m_Chunks) + { + Chunk.second.BroadcastPendingChanges(); + } } |