Added CustomName and Health to sended Metadata of Monsters.
Fixes #2113
This commit is contained in:
parent
9b3b047004
commit
d364b779d1
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -3226,7 +3226,7 @@ void cProtocol180::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a_En
|
||||
}
|
||||
a_Pkt.WriteBEUInt8(0); // Byte(0) + index 0
|
||||
a_Pkt.WriteBEUInt8(Flags);
|
||||
|
||||
|
||||
switch (a_Entity.GetEntityType())
|
||||
{
|
||||
case cEntity::etPlayer: break; // TODO?
|
||||
@ -3332,6 +3332,19 @@ void cProtocol180::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a_En
|
||||
|
||||
void cProtocol180::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob)
|
||||
{
|
||||
// Living Enitiy Metadata
|
||||
if (a_Mob.HasCustomName())
|
||||
{
|
||||
a_Pkt.WriteBEUInt8(0x82);
|
||||
a_Pkt.WriteString(a_Mob.GetCustomName());
|
||||
|
||||
a_Pkt.WriteBEUInt8(0x03);
|
||||
a_Pkt.WriteBool(a_Mob.IsCustomNameAlwaysVisible());
|
||||
}
|
||||
|
||||
a_Pkt.WriteBEUInt8(0x66);
|
||||
a_Pkt.WriteBEFloat(a_Mob.GetHealth());
|
||||
|
||||
switch (a_Mob.GetMobType())
|
||||
{
|
||||
case mtBat:
|
||||
|
Loading…
Reference in New Issue
Block a user