From 8405b8969f205ffae219361dfc03f3b4c680ce73 Mon Sep 17 00:00:00 2001 From: 12xx12 <44411062+12xx12@users.noreply.github.com> Date: Fri, 5 Mar 2021 16:08:30 +0100 Subject: Adding Boss bar (#5025) + Add boss bar Co-authored-by: Tiger Wang --- src/Broadcaster.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/Broadcaster.cpp') diff --git a/src/Broadcaster.cpp b/src/Broadcaster.cpp index 98759a58b..c8d2de615 100644 --- a/src/Broadcaster.cpp +++ b/src/Broadcaster.cpp @@ -171,6 +171,19 @@ void cWorld::BroadcastBlockEntity(Vector3i a_BlockPos, const cClientHandle * a_E +void cWorld::BroadcastBossBarUpdateHealth(const cEntity & a_Entity, UInt32 a_UniqueID, float a_FractionFilled) +{ + ForClientsWithEntity(a_Entity, *this, nullptr, [&](cClientHandle & a_Client) + { + a_Client.SendBossBarUpdateHealth(a_UniqueID, a_FractionFilled); + } + ); +} + + + + + void cWorld::BroadcastChat(const AString & a_Message, const cClientHandle * a_Exclude, eMessageType a_ChatPrefix) { ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client) @@ -444,11 +457,11 @@ void cWorld::BroadcastPlayerListRemovePlayer(const cPlayer & a_Player, const cCl -void cWorld::BroadcastPlayerListUpdateGameMode(const cPlayer & a_Player, const cClientHandle * a_Exclude) +void cWorld::BroadcastPlayerListUpdateDisplayName(const cPlayer & a_Player, const AString & a_CustomName, const cClientHandle * a_Exclude) { ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client) { - a_Client.SendPlayerListUpdateGameMode(a_Player); + a_Client.SendPlayerListUpdateDisplayName(a_Player, a_CustomName); } ); } @@ -457,11 +470,11 @@ void cWorld::BroadcastPlayerListUpdateGameMode(const cPlayer & a_Player, const c -void cWorld::BroadcastPlayerListUpdatePing(const cPlayer & a_Player, const cClientHandle * a_Exclude) +void cWorld::BroadcastPlayerListUpdateGameMode(const cPlayer & a_Player, const cClientHandle * a_Exclude) { ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client) { - a_Client.SendPlayerListUpdatePing(a_Player); + a_Client.SendPlayerListUpdateGameMode(a_Player); } ); } @@ -470,11 +483,11 @@ void cWorld::BroadcastPlayerListUpdatePing(const cPlayer & a_Player, const cClie -void cWorld::BroadcastPlayerListUpdateDisplayName(const cPlayer & a_Player, const AString & a_CustomName, const cClientHandle * a_Exclude) +void cWorld::BroadcastPlayerListUpdatePing(const cPlayer & a_Player, const cClientHandle * a_Exclude) { ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client) { - a_Client.SendPlayerListUpdateDisplayName(a_Player, a_CustomName); + a_Client.SendPlayerListUpdatePing(a_Player); } ); } -- cgit v1.2.3