summaryrefslogtreecommitdiffstats
path: root/src/Mobs/EnderDragon.cpp
diff options
context:
space:
mode:
author12xx12 <44411062+12xx12@users.noreply.github.com>2021-03-05 16:08:30 +0100
committerGitHub <noreply@github.com>2021-03-05 16:08:30 +0100
commit8405b8969f205ffae219361dfc03f3b4c680ce73 (patch)
treecc1aef4347d9e399b80a32afa16b657885fd3603 /src/Mobs/EnderDragon.cpp
parentAdd Mushrooms to Generator and fixed up the roofed forest (#5134) (diff)
downloadcuberite-8405b8969f205ffae219361dfc03f3b4c680ce73.tar
cuberite-8405b8969f205ffae219361dfc03f3b4c680ce73.tar.gz
cuberite-8405b8969f205ffae219361dfc03f3b4c680ce73.tar.bz2
cuberite-8405b8969f205ffae219361dfc03f3b4c680ce73.tar.lz
cuberite-8405b8969f205ffae219361dfc03f3b4c680ce73.tar.xz
cuberite-8405b8969f205ffae219361dfc03f3b4c680ce73.tar.zst
cuberite-8405b8969f205ffae219361dfc03f3b4c680ce73.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/EnderDragon.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Mobs/EnderDragon.cpp b/src/Mobs/EnderDragon.cpp
index a3ba5f937..e33fb21f1 100644
--- a/src/Mobs/EnderDragon.cpp
+++ b/src/Mobs/EnderDragon.cpp
@@ -2,6 +2,8 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "EnderDragon.h"
+#include "../ClientHandle.h"
+#include "../CompositeChat.h"
@@ -17,6 +19,21 @@ cEnderDragon::cEnderDragon(void) :
+bool cEnderDragon::DoTakeDamage(TakeDamageInfo & a_TDI)
+{
+ if (!Super::DoTakeDamage(a_TDI))
+ {
+ return false;
+ }
+
+ m_World->BroadcastBossBarUpdateHealth(*this, GetUniqueID(), GetHealth() / GetMaxHealth());
+ return true;
+}
+
+
+
+
+
void cEnderDragon::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
// No drops
@@ -25,3 +42,11 @@ void cEnderDragon::GetDrops(cItems & a_Drops, cEntity * a_Killer)
+
+void cEnderDragon::SpawnOn(cClientHandle & a_Client)
+{
+ Super::SpawnOn(a_Client);
+
+ // Red boss bar with no divisions that plays boss music and creates fog:
+ a_Client.SendBossBarAdd(GetUniqueID(), cCompositeChat("Ender Dragon"), GetHealth() / GetMaxHealth(), BossBarColor::Red, BossBarDivisionType::None, false, true, true);
+}