diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-04-01 22:56:25 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-04-01 22:56:25 +0200 |
commit | 578560d2132188279e4b0930212edd915bc90008 (patch) | |
tree | 2519ecc38e0124bd58916b409f9222ee410c7e5e /source/BlockEntity.h | |
parent | Hotfix for FS #347. (diff) | |
download | cuberite-578560d2132188279e4b0930212edd915bc90008.tar cuberite-578560d2132188279e4b0930212edd915bc90008.tar.gz cuberite-578560d2132188279e4b0930212edd915bc90008.tar.bz2 cuberite-578560d2132188279e4b0930212edd915bc90008.tar.lz cuberite-578560d2132188279e4b0930212edd915bc90008.tar.xz cuberite-578560d2132188279e4b0930212edd915bc90008.tar.zst cuberite-578560d2132188279e4b0930212edd915bc90008.zip |
Diffstat (limited to 'source/BlockEntity.h')
-rw-r--r-- | source/BlockEntity.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/BlockEntity.h b/source/BlockEntity.h index b7d1fe6c4..d62f8aa5e 100644 --- a/source/BlockEntity.h +++ b/source/BlockEntity.h @@ -43,18 +43,18 @@ protected: {} public: virtual ~cBlockEntity() {}; - virtual void Destroy() {}; + virtual void Destroy(void) {}; // Position, in absolute block coordinates: - int GetPosX() { return m_PosX; } - int GetPosY() { return m_PosY; } - int GetPosZ() { return m_PosZ; } + int GetPosX(void) const { return m_PosX; } + int GetPosY(void) const { return m_PosY; } + int GetPosZ(void) const { return m_PosZ; } - ENUM_BLOCK_ID GetBlockType() { return m_BlockType; } + ENUM_BLOCK_ID GetBlockType(void) const { return m_BlockType; } cWorld * GetWorld(void) const {return m_World; } - virtual void SaveToJson (Json::Value & a_Value ) = 0; + virtual void SaveToJson (Json::Value & a_Value) = 0; virtual void UsedBy( cPlayer * a_Player ) = 0; @@ -62,6 +62,9 @@ public: To send to all eligible clients, use cWorld::BroadcastBlockEntity() */ virtual void SendTo(cClientHandle & a_Client) = 0; + + /// Ticks the entity; returns true if the chunk should be marked as dirty as a result of this ticking. By default does nothing. + virtual bool Tick(float a_Dt) { return false; } protected: int m_PosX; // Position in absolute block coordinates |