From 875c2557c30aa5254c2ec3f4062ec463418c7d09 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sat, 12 Apr 2014 00:01:15 +0200 Subject: Implemented the skeleton code for the beacon. There is no handling for the GUI. It can now check how big the pyramid is under the beacon. --- src/BlockEntities/BeaconEntity.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/BlockEntities/BeaconEntity.h (limited to 'src/BlockEntities/BeaconEntity.h') diff --git a/src/BlockEntities/BeaconEntity.h b/src/BlockEntities/BeaconEntity.h new file mode 100644 index 000000000..1dfd745b2 --- /dev/null +++ b/src/BlockEntities/BeaconEntity.h @@ -0,0 +1,40 @@ + +#pragma once + +#include "BlockEntity.h" + + + + + +namespace Json +{ + class Value; +} + + + + + +class cBeaconEntity : + public cBlockEntity +{ + typedef cBlockEntity super; + +public: + + // The initial constructor + cBeaconEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World); + + // Returns the amount of layers the pyramid below the beacon has. + int GetPyramidLevel(void); + + // Returns true if the block is a diamond block, an golden block, an iron block or an emerald block. + bool IsMineralBlock(BLOCKTYPE a_BlockType); + + // cBlockEntity overrides: + virtual void SaveToJson(Json::Value& a_Value ) override; + virtual void SendTo(cClientHandle & a_Client) override; + virtual void UsedBy(cPlayer * a_Player) override; + virtual bool Tick(float a_Dt, cChunk & /* a_Chunk */) override; +} ; \ No newline at end of file -- cgit v1.2.3