diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-25 11:54:36 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-25 11:54:36 +0200 |
commit | fb9a00a64ed69d22a1c181bb0b3af99f8686c4dd (patch) | |
tree | 1529d406bbbc97b1f1da6e2d0d1cccc7f1be5d9c /source/ChunkMap.cpp | |
parent | Sockets are now owned by SocketThreads instead of ClientHandle (FS #246 and FS #247) (diff) | |
download | cuberite-fb9a00a64ed69d22a1c181bb0b3af99f8686c4dd.tar cuberite-fb9a00a64ed69d22a1c181bb0b3af99f8686c4dd.tar.gz cuberite-fb9a00a64ed69d22a1c181bb0b3af99f8686c4dd.tar.bz2 cuberite-fb9a00a64ed69d22a1c181bb0b3af99f8686c4dd.tar.lz cuberite-fb9a00a64ed69d22a1c181bb0b3af99f8686c4dd.tar.xz cuberite-fb9a00a64ed69d22a1c181bb0b3af99f8686c4dd.tar.zst cuberite-fb9a00a64ed69d22a1c181bb0b3af99f8686c4dd.zip |
Diffstat (limited to '')
-rw-r--r-- | source/ChunkMap.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/ChunkMap.cpp b/source/ChunkMap.cpp index 508d5ae11..ee69e6cc0 100644 --- a/source/ChunkMap.cpp +++ b/source/ChunkMap.cpp @@ -465,6 +465,25 @@ void cChunkMap::BroadcastSoundEffect(const AString & a_SoundName, int a_SrcX, in +void cChunkMap::BroadcastBlockBreakAnimation(int a_entityID, int a_blockX, int a_blockY, int a_blockZ, char a_stage, const cClientHandle * a_Exclude) +{ + cCSLock Lock(m_CSLayers); + int ChunkX, ChunkZ; + + cChunkDef::BlockToChunk(a_blockX, a_blockY, a_blockZ, ChunkX, ChunkZ); + cChunkPtr Chunk = GetChunkNoGen(ChunkX, 0, ChunkZ); + if (Chunk == NULL) + { + return; + } + // It's perfectly legal to broadcast packets even to invalid chunks! + Chunk->BroadcastBlockBreakAnimation(a_entityID, a_blockX, a_blockY, a_blockZ, a_stage, a_Exclude); +} + + + + + void cChunkMap::BroadcastChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSLayers); |