diff options
author | Lukas Pioch <lukas@zgow.de> | 2017-07-07 09:31:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-07 09:31:45 +0200 |
commit | 885d8287125439047ca2318f8e349b8da279e612 (patch) | |
tree | 2f54b688dba0f49b64544d3c1220a16a6936cd6f /src/BlockEntities/BedEntity.h | |
parent | Changed Lua plugins to only execute files ending in .lua (#3831) (diff) | |
download | cuberite-885d8287125439047ca2318f8e349b8da279e612.tar cuberite-885d8287125439047ca2318f8e349b8da279e612.tar.gz cuberite-885d8287125439047ca2318f8e349b8da279e612.tar.bz2 cuberite-885d8287125439047ca2318f8e349b8da279e612.tar.lz cuberite-885d8287125439047ca2318f8e349b8da279e612.tar.xz cuberite-885d8287125439047ca2318f8e349b8da279e612.tar.zst cuberite-885d8287125439047ca2318f8e349b8da279e612.zip |
Diffstat (limited to 'src/BlockEntities/BedEntity.h')
-rw-r--r-- | src/BlockEntities/BedEntity.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/BlockEntities/BedEntity.h b/src/BlockEntities/BedEntity.h new file mode 100644 index 000000000..8caa205c4 --- /dev/null +++ b/src/BlockEntities/BedEntity.h @@ -0,0 +1,45 @@ + +// BedEntity.h + +#pragma once + +#include "BlockEntity.h" + + + + + +// tolua_begin + +class cBedEntity : + public cBlockEntity +{ + typedef cBlockEntity Super; +public: + // tolua_end + + BLOCKENTITY_PROTODEF(cBedEntity) + + cBedEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World, short a_Color = E_META_WOOL_RED); + + // tolua_begin + + /** Returns the color of the bed */ + short GetColor(void) const { return m_Color; } + + /** Set the color of the bed. */ + void SetColor(short a_Color); + + /** Returns true if this is the pillow block, it has then the meta 8. */ + bool IsPillowBlock(void) { return ((m_BlockMeta & 0x08) == 0x08); } + + // tolua_end + + // cBlockEntity overrides: + virtual void CopyFrom(const cBlockEntity & a_Src) override; + virtual bool UsedBy(cPlayer * a_Player) override { return false; } + virtual void SendTo(cClientHandle & a_Client) override; + +private: + short m_Color; +}; // tolua_export |