summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol_1_9.cpp
diff options
context:
space:
mode:
authorPokechu22 <pokechu022@gmail.com>2017-01-03 21:19:29 +0100
committersweetgiorni <sweet.giorni@gmail.com>2017-01-03 22:11:26 +0100
commit28cc26c54ca09ed9ceb2ed2df53dc323f0be405c (patch)
tree3b93c8049db5188fcd4c41bcd3267c4fc9e1c293 /src/Protocol/Protocol_1_9.cpp
parentPlayer check (diff)
downloadcuberite-28cc26c54ca09ed9ceb2ed2df53dc323f0be405c.tar
cuberite-28cc26c54ca09ed9ceb2ed2df53dc323f0be405c.tar.gz
cuberite-28cc26c54ca09ed9ceb2ed2df53dc323f0be405c.tar.bz2
cuberite-28cc26c54ca09ed9ceb2ed2df53dc323f0be405c.tar.lz
cuberite-28cc26c54ca09ed9ceb2ed2df53dc323f0be405c.tar.xz
cuberite-28cc26c54ca09ed9ceb2ed2df53dc323f0be405c.tar.zst
cuberite-28cc26c54ca09ed9ceb2ed2df53dc323f0be405c.zip
Diffstat (limited to 'src/Protocol/Protocol_1_9.cpp')
-rw-r--r--src/Protocol/Protocol_1_9.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp
index 680675ca3..69b8deb55 100644
--- a/src/Protocol/Protocol_1_9.cpp
+++ b/src/Protocol/Protocol_1_9.cpp
@@ -2355,12 +2355,14 @@ void cProtocol_1_9_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);
HANDLE_READ(a_ByteBuffer, ReadVarInt, UInt32, MainHand);
m_Client->SetLocale(Locale);
m_Client->SetViewDistance(ViewDistance);
- // TODO: Handle other values
+ m_Client->GetPlayer()->SetSkinParts(SkinParts);
+ m_Client->GetPlayer()->SetMainHand(static_cast<eMainHand>(MainHand));
+ // TODO: Handle chat flags and chat colors
}
@@ -3552,9 +3554,17 @@ void cProtocol_1_9_0::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a
a_Pkt.WriteBEUInt8(METADATA_TYPE_STRING);
a_Pkt.WriteString(Player.GetName());
- a_Pkt.WriteBEUInt8(6); // Start metadata - Index 6: Health
+ a_Pkt.WriteBEUInt8(6); // Index 6: Health
a_Pkt.WriteBEUInt8(METADATA_TYPE_FLOAT);
a_Pkt.WriteBEFloat(static_cast<float>(Player.GetHealth()));
+
+ a_Pkt.WriteBEUInt8(12);
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_BYTE);
+ a_Pkt.WriteBEUInt8(static_cast<UInt8>(Player.GetSkinParts()));
+
+ a_Pkt.WriteBEUInt8(13);
+ a_Pkt.WriteBEUInt8(METADATA_TYPE_BYTE);
+ a_Pkt.WriteBEUInt8(static_cast<UInt8>(Player.GetMainHand()));
break;
}
case cEntity::etPickup: