From e92b9e7ecbdf2918aab59d4eeb7bb5966430b264 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 24 Aug 2012 07:58:26 +0000 Subject: Monster classes don't use cPackets. Chat messages are sent / broadcast without cPackets. BlockEntities don't use cPackets. git-svn-id: http://mc-server.googlecode.com/svn/trunk@783 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cPlayer.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source/cPlayer.h') 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 -- cgit v1.2.3