summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol17x.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol17x.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index c5c0f4a03..53bb01790 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -3015,6 +3015,19 @@ void cProtocol172::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a_En
void cProtocol172::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
{
+ // Living Enitiy Metadata
+ if (a_Mob.HasCustomName())
+ {
+ a_Pkt.WriteBEUInt8(0x8a);
+ a_Pkt.WriteString(a_Mob.GetCustomName());
+
+ a_Pkt.WriteBEUInt8(0x0b);
+ a_Pkt.WriteBool(a_Mob.IsCustomNameAlwaysVisible());
+ }
+
+ a_Pkt.WriteBEUInt8(0x66);
+ a_Pkt.WriteBEFloat(a_Mob.GetHealth());
+
switch (a_Mob.GetMobType())
{
case mtBat:
@@ -3208,15 +3221,6 @@ void cProtocol172::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
break;
}
} // switch (a_Mob.GetType())
-
- // Custom name:
- if (a_Mob.HasCustomName())
- {
- a_Pkt.WriteBEUInt8(0x8a);
- a_Pkt.WriteString(a_Mob.GetCustomName());
- a_Pkt.WriteBEUInt8(0x0b);
- a_Pkt.WriteBEUInt8(a_Mob.IsCustomNameAlwaysVisible() ? 1 : 0);
- }
}