MCPcopy Create free account
hub / github.com/cuberite/cuberite / SendPlayerMoveLook

Method SendPlayerMoveLook

src/Protocol/Protocol125.cpp:717–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715
716
717void cProtocol125::SendPlayerMoveLook(void)
718{
719 cCSLock Lock(m_CSPacket);
720
721 /*
722 LOGD("Sending PlayerMoveLook: {%0.2f, %0.2f, %0.2f}, stance %0.2f, OnGround: %d",
723 m_Player->GetPosX(), m_Player->GetPosY(), m_Player->GetPosZ(), m_Player->GetStance(), m_Player->IsOnGround() ? 1 : 0
724 );
725 */
726
727 WriteByte (PACKET_PLAYER_MOVE_LOOK);
728 cPlayer * Player = m_Client->GetPlayer();
729 WriteDouble(Player->GetPosX());
730 WriteDouble(Player->GetStance() + 0.03); // Add a small amount so that the player doesn't start inside a block
731 WriteDouble(Player->GetPosY() + 0.03); // Add a small amount so that the player doesn't start inside a block
732 WriteDouble(Player->GetPosZ());
733 WriteFloat ((float)(Player->GetYaw()));
734 WriteFloat ((float)(Player->GetPitch()));
735 WriteBool (Player->IsOnGround());
736 Flush();
737}
738
739
740

Callers 2

TeleportToCoordsMethod · 0.45
SendRotationMethod · 0.45

Calls 8

GetStanceMethod · 0.80
GetYawMethod · 0.80
IsOnGroundMethod · 0.80
GetPlayerMethod · 0.45
GetPosXMethod · 0.45
GetPosYMethod · 0.45
GetPosZMethod · 0.45
GetPitchMethod · 0.45

Tested by

no test coverage detected