1
0

Adding Boss bar (#5025)

+ Add boss bar

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
This commit is contained in:
12xx12
2021-03-05 16:08:30 +01:00
committed by GitHub
parent 4d6235c807
commit 8405b8969f
23 changed files with 781 additions and 108 deletions

View File

@@ -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,6 +457,19 @@ void cWorld::BroadcastPlayerListRemovePlayer(const cPlayer & a_Player, const cCl
void cWorld::BroadcastPlayerListUpdateDisplayName(const cPlayer & a_Player, const AString & a_CustomName, const cClientHandle * a_Exclude)
{
ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client)
{
a_Client.SendPlayerListUpdateDisplayName(a_Player, a_CustomName);
}
);
}
void cWorld::BroadcastPlayerListUpdateGameMode(const cPlayer & a_Player, const cClientHandle * a_Exclude)
{
ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client)
@@ -470,19 +496,6 @@ void cWorld::BroadcastPlayerListUpdatePing(const cPlayer & a_Player, const cClie
void cWorld::BroadcastPlayerListUpdateDisplayName(const cPlayer & a_Player, const AString & a_CustomName, const cClientHandle * a_Exclude)
{
ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client)
{
a_Client.SendPlayerListUpdateDisplayName(a_Player, a_CustomName);
}
);
}
void cWorld::BroadcastRemoveEntityEffect(const cEntity & a_Entity, int a_EffectID, const cClientHandle * a_Exclude)
{
ForClientsWithEntity(a_Entity, *this, a_Exclude, [&](cClientHandle & a_Client)