summaryrefslogtreecommitdiffstats
path: root/source/cPlayer.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-24 09:58:26 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-24 09:58:26 +0200
commite92b9e7ecbdf2918aab59d4eeb7bb5966430b264 (patch)
tree1a998d44e5faab91c54ea8517dd9fa02b3732ef7 /source/cPlayer.h
parentAdded plugin name to deprecation messages (diff)
downloadcuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.gz
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.bz2
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.lz
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.xz
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.zst
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.zip
Diffstat (limited to 'source/cPlayer.h')
-rw-r--r--source/cPlayer.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/cPlayer.h b/source/cPlayer.h
index ba8e15880..91aa9c831 100644
--- a/source/cPlayer.h
+++ b/source/cPlayer.h
@@ -31,7 +31,8 @@ public:
virtual void Initialize( cWorld* a_World ); //tolua_export
- virtual cPacket * GetSpawnPacket(void) const override;
+ virtual void SpawnOn(cClientHandle & a_Client) override;
+
virtual void Tick(float a_Dt) override;
void SetTouchGround( bool a_bTouchGround );
@@ -42,11 +43,14 @@ public:
inline bool GetFlying() { return m_bTouchGround; } //tolua_export
inline bool IsOnGround(void) const {return m_bTouchGround; } // tolua_export
inline const double GetStance(void) const { return m_Pos.y + 1.62; } //tolua_export // TODO: Proper stance when crouching etc.
- inline cInventory & GetInventory() { if(GetGameMode() == eGameMode_Survival) return *m_Inventory; else return *m_CreativeInventory; } //tolua_export
+ inline cInventory & GetInventory(void) { if (GetGameMode() == eGameMode_Survival) return *m_Inventory; else return *m_CreativeInventory; } //tolua_export
+ inline const cInventory & GetInventory(void) const { if (GetGameMode() == eGameMode_Survival) return *m_Inventory; else return *m_CreativeInventory; }
+
+ inline const cItem & GetEquippedItem(void) const {return GetInventory().GetEquippedItem(); }
virtual void TeleportTo( const double & a_PosX, const double & a_PosY, const double & a_PosZ ); //tolua_export
- eGameMode GetGameMode() { return m_GameMode; } //tolua_export
+ eGameMode GetGameMode(void) const { return m_GameMode; } //tolua_export
std::string GetIP() { return m_IP; } //tolua_export
float GetLastBlockActionTime() { return m_LastBlockActionTime; } //tolua_export
int GetLastBlockActionCnt() { return m_LastBlockActionCnt; } //tolua_export