diff options
author | Pokechu22 <pokechu022@gmail.com> | 2017-01-03 21:19:29 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2017-01-03 21:19:29 +0100 |
commit | 9c2a0bb7b9e2d8402813f4755398884a801fec59 (patch) | |
tree | aafb4b43ee81c59eea01d06b725e04e332ca36ea /src/Protocol/Protocol_1_8.cpp | |
parent | Debuggers: PluginStats are now output only on request. (#3513) (diff) | |
download | cuberite-9c2a0bb7b9e2d8402813f4755398884a801fec59.tar cuberite-9c2a0bb7b9e2d8402813f4755398884a801fec59.tar.gz cuberite-9c2a0bb7b9e2d8402813f4755398884a801fec59.tar.bz2 cuberite-9c2a0bb7b9e2d8402813f4755398884a801fec59.tar.lz cuberite-9c2a0bb7b9e2d8402813f4755398884a801fec59.tar.xz cuberite-9c2a0bb7b9e2d8402813f4755398884a801fec59.tar.zst cuberite-9c2a0bb7b9e2d8402813f4755398884a801fec59.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol_1_8.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp index bbeb3ae8b..2e7902303 100644 --- a/src/Protocol/Protocol_1_8.cpp +++ b/src/Protocol/Protocol_1_8.cpp @@ -2311,11 +2311,12 @@ void cProtocol_1_8_0::HandlePacketClientSettings(cByteBuffer & a_ByteBuffer) HANDLE_READ(a_ByteBuffer, ReadBEUInt8, UInt8, ViewDistance); HANDLE_READ(a_ByteBuffer, ReadBEUInt8, UInt8, ChatFlags); HANDLE_READ(a_ByteBuffer, ReadBool, bool, ChatColors); - HANDLE_READ(a_ByteBuffer, ReadBEUInt8, UInt8, SkinFlags); + HANDLE_READ(a_ByteBuffer, ReadBEUInt8, UInt8, SkinParts); m_Client->SetLocale(Locale); m_Client->SetViewDistance(ViewDistance); - // TODO: Handle other values + m_Client->GetPlayer()->SetSkinParts(SkinParts); + // TODO: Handle chat flags and chat colors } @@ -3234,7 +3235,20 @@ void cProtocol_1_8_0::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a switch (a_Entity.GetEntityType()) { - case cEntity::etPlayer: break; // TODO? + case cEntity::etPlayer: + { + auto & Player = reinterpret_cast<const cPlayer &>(a_Entity); + + // Player health (not handled since players aren't monsters) + a_Pkt.WriteBEUInt8(0x66); + a_Pkt.WriteBEFloat(static_cast<float>(Player.GetHealth())); + + // Skin flags + a_Pkt.WriteBEUInt8(0x0A); + a_Pkt.WriteBEUInt8(static_cast<UInt8>(Player.GetSkinParts())); + + break; + } case cEntity::etPickup: { a_Pkt.WriteBEUInt8((5 << 5) | 10); // Slot(5) + index 10 |