summaryrefslogtreecommitdiffstats
path: root/source/ChunkMap.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-29 22:43:42 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-29 22:43:42 +0200
commit17486c785331e809f5294fee40367b1590e0d36b (patch)
tree3104a260f3eac320a190af73a3dced00cb77bcfe /source/ChunkMap.cpp
parentFixed memory leaks in cWindow and cProtocolRecognizer (diff)
downloadcuberite-17486c785331e809f5294fee40367b1590e0d36b.tar
cuberite-17486c785331e809f5294fee40367b1590e0d36b.tar.gz
cuberite-17486c785331e809f5294fee40367b1590e0d36b.tar.bz2
cuberite-17486c785331e809f5294fee40367b1590e0d36b.tar.lz
cuberite-17486c785331e809f5294fee40367b1590e0d36b.tar.xz
cuberite-17486c785331e809f5294fee40367b1590e0d36b.tar.zst
cuberite-17486c785331e809f5294fee40367b1590e0d36b.zip
Diffstat (limited to '')
-rw-r--r--source/ChunkMap.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/ChunkMap.cpp b/source/ChunkMap.cpp
index ee69e6cc0..af8f09820 100644
--- a/source/ChunkMap.cpp
+++ b/source/ChunkMap.cpp
@@ -484,6 +484,25 @@ void cChunkMap::BroadcastBlockBreakAnimation(int a_entityID, int a_blockX, int a
+void cChunkMap::BroadcastUseBed(const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ )
+{
+ 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->BroadcastUseBed(a_Entity, a_BlockX, a_BlockY, a_BlockZ);
+}
+
+
+
+
+
void cChunkMap::BroadcastChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer, const cClientHandle * a_Exclude)
{
cCSLock Lock(m_CSLayers);