1
0

Track skin part and main hand preferences (#3498)

This commit is contained in:
Pokechu22
2017-01-03 12:19:29 -08:00
committed by Mattes D
parent 45ce828a16
commit 9c2a0bb7b9
7 changed files with 253 additions and 7 deletions

View File

@@ -90,7 +90,9 @@ cPlayer::cPlayer(cClientHandlePtr a_Client, const AString & a_PlayerName) :
m_TicksUntilNextSave(PLAYER_INVENTORY_SAVE_INTERVAL),
m_bIsTeleporting(false),
m_UUID((a_Client != nullptr) ? a_Client->GetUUID() : ""),
m_CustomName("")
m_CustomName(""),
m_SkinParts(0),
m_MainHand(mhRight)
{
ASSERT(a_PlayerName.length() <= 16); // Otherwise this player could crash many clients...
@@ -2632,6 +2634,26 @@ bool cPlayer::PlaceBlocks(const sSetBlockVector & a_Blocks)
void cPlayer::SetSkinParts(int a_Parts)
{
m_SkinParts = a_Parts & spMask;
m_World->BroadcastEntityMetadata(*this, m_ClientHandle.get());
}
void cPlayer::SetMainHand(eMainHand a_Hand)
{
m_MainHand = a_Hand;
m_World->BroadcastEntityMetadata(*this, m_ClientHandle.get());
}
void cPlayer::AttachTo(cEntity * a_AttachTo)
{
// Different attach, if this is a spectator