diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-07-15 23:18:11 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-07-15 23:18:11 +0200 |
commit | eadd761a299af09c7c4cd23f52509eb8dfce629f (patch) | |
tree | f975431fa652a758221e5959026ea6a85fcf7987 /src/Protocol/Protocol18x.cpp | |
parent | Merge pull request #2353 from SamJBarney/DyedArmor (diff) | |
parent | Added CustomName and Health to sended Metadata of Monsters. (diff) | |
download | cuberite-eadd761a299af09c7c4cd23f52509eb8dfce629f.tar cuberite-eadd761a299af09c7c4cd23f52509eb8dfce629f.tar.gz cuberite-eadd761a299af09c7c4cd23f52509eb8dfce629f.tar.bz2 cuberite-eadd761a299af09c7c4cd23f52509eb8dfce629f.tar.lz cuberite-eadd761a299af09c7c4cd23f52509eb8dfce629f.tar.xz cuberite-eadd761a299af09c7c4cd23f52509eb8dfce629f.tar.zst cuberite-eadd761a299af09c7c4cd23f52509eb8dfce629f.zip |
Diffstat (limited to 'src/Protocol/Protocol18x.cpp')
-rw-r--r-- | src/Protocol/Protocol18x.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp index 98b22add1..f4f32dfdb 100644 --- a/src/Protocol/Protocol18x.cpp +++ b/src/Protocol/Protocol18x.cpp @@ -3207,7 +3207,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? @@ -3313,6 +3313,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: |