diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-05-04 10:10:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 10:10:47 +0200 |
commit | 07ca09574072b303064eafb2751f8f83c865f083 (patch) | |
tree | a863831747b046c143a3e2d09ad1f665501d9a0d /src/Broadcaster.cpp | |
parent | Buttons can now be triggered by arrows. (#4670) (diff) | |
download | cuberite-07ca09574072b303064eafb2751f8f83c865f083.tar cuberite-07ca09574072b303064eafb2751f8f83c865f083.tar.gz cuberite-07ca09574072b303064eafb2751f8f83c865f083.tar.bz2 cuberite-07ca09574072b303064eafb2751f8f83c865f083.tar.lz cuberite-07ca09574072b303064eafb2751f8f83c865f083.tar.xz cuberite-07ca09574072b303064eafb2751f8f83c865f083.tar.zst cuberite-07ca09574072b303064eafb2751f8f83c865f083.zip |
Diffstat (limited to 'src/Broadcaster.cpp')
-rw-r--r-- | src/Broadcaster.cpp | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/src/Broadcaster.cpp b/src/Broadcaster.cpp index 3534e0bd0..1c59405e9 100644 --- a/src/Broadcaster.cpp +++ b/src/Broadcaster.cpp @@ -197,11 +197,11 @@ void cWorld::BroadcastChat(const cCompositeChat & a_Message, const cClientHandle -void cWorld::BroadcastCollectEntity(const cEntity & a_Entity, const cPlayer & a_Player, int a_Count, const cClientHandle * a_Exclude) +void cWorld::BroadcastCollectEntity(const cEntity & a_Collected, const cEntity & a_Collector, unsigned a_Count, const cClientHandle * a_Exclude) { - ForClientsWithEntity(a_Entity, *this, a_Exclude, [&](cClientHandle & a_Client) + ForClientsWithEntity(a_Collected, *this, a_Exclude, [&](cClientHandle & a_Client) { - a_Client.SendCollectEntity(a_Entity, a_Player, a_Count); + a_Client.SendCollectEntity(a_Collected, a_Collector, a_Count); } ); } @@ -314,24 +314,11 @@ void cWorld::BroadcastEntityMetadata(const cEntity & a_Entity, const cClientHand -void cWorld::BroadcastEntityRelMove(const cEntity & a_Entity, Vector3<Int8> a_RelMove, const cClientHandle * a_Exclude) +void cWorld::BroadcastEntityPosition(const cEntity & a_Entity, const cClientHandle * a_Exclude) { - ForClientsWithEntity(a_Entity, *this, a_Exclude, [&](cClientHandle & a_Client) - { - a_Client.SendEntityRelMove(a_Entity, a_RelMove.x, a_RelMove.y, a_RelMove.z); - } - ); -} - - - - - -void cWorld::BroadcastEntityRelMoveLook(const cEntity & a_Entity, Vector3<Int8> a_RelMove, const cClientHandle * a_Exclude) -{ - ForClientsWithEntity(a_Entity, *this, a_Exclude, [&](cClientHandle & a_Client) + ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client) { - a_Client.SendEntityRelMoveLook(a_Entity, a_RelMove.x, a_RelMove.y, a_RelMove.z); + a_Client.SendEntityPosition(a_Entity); } ); } @@ -561,19 +548,6 @@ void cWorld::BroadcastSpawnEntity(cEntity & a_Entity, const cClientHandle * a_Ex -void cWorld::BroadcastTeleportEntity(const cEntity & a_Entity, const cClientHandle * a_Exclude) -{ - ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client) - { - a_Client.SendTeleportEntity(a_Entity); - } - ); -} - - - - - void cWorld::BroadcastThunderbolt(Vector3i a_BlockPos, const cClientHandle * a_Exclude) { ForClientsWithChunkAtPos(a_BlockPos, *this, a_Exclude, [&](cClientHandle & a_Client) |