summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities
diff options
context:
space:
mode:
Diffstat (limited to 'src/BlockEntities')
-rw-r--r--src/BlockEntities/BeaconEntity.cpp2
-rw-r--r--src/BlockEntities/BeaconEntity.h42
2 files changed, 27 insertions, 17 deletions
diff --git a/src/BlockEntities/BeaconEntity.cpp b/src/BlockEntities/BeaconEntity.cpp
index af6c124c0..38b710181 100644
--- a/src/BlockEntities/BeaconEntity.cpp
+++ b/src/BlockEntities/BeaconEntity.cpp
@@ -121,10 +121,8 @@ bool cBeaconEntity::IsValidPotion(cEntityEffect::eType a_Potion, char a_BeaconLe
bool cBeaconEntity::SelectPrimaryPotion(cEntityEffect::eType a_Potion)
{
- LOG("SelectPrimaryPotion!");
if (!IsValidPotion(a_Potion, m_BeaconLevel))
{
- LOG("FALLSE!");
return false;
}
diff --git a/src/BlockEntities/BeaconEntity.h b/src/BlockEntities/BeaconEntity.h
index 52111e82a..4710e91e0 100644
--- a/src/BlockEntities/BeaconEntity.h
+++ b/src/BlockEntities/BeaconEntity.h
@@ -1,3 +1,10 @@
+// BeaconEntity.h
+
+// Declares the cBeaconEntity class representing a single beacon in the world
+
+
+
+
#pragma once
@@ -16,14 +23,26 @@ namespace Json
+// tolua_begin
class cBeaconEntity :
public cBlockEntityWithItems
{
typedef cBlockEntityWithItems super;
public:
+ // tolua_end
+
cBeaconEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World);
+ bool LoadFromJson(const Json::Value & a_Value);
+ // cBlockEntity overrides:
+ virtual void SaveToJson(Json::Value& a_Value) override;
+ virtual void SendTo(cClientHandle & a_Client) override;
+ virtual bool Tick(float a_Dt, cChunk & a_Chunk) override;
+ virtual void UsedBy(cPlayer * a_Player) override;
+
+ // tolua_begin
+
/** Is the beacon active? */
bool IsActive(void) const { return m_IsActive; }
@@ -45,33 +64,26 @@ public:
/** Is the beacon blocked by non-transparent blocks that are higher than the beacon? */
bool IsBeaconBlocked(void);
- /** Returns true if the block is a diamond block, a golden block, an iron block or an emerald block. */
- static bool IsMineralBlock(BLOCKTYPE a_BlockType);
-
- /** Returns true if the potion can be used. */
- static bool IsValidPotion(cEntityEffect::eType a_Potion, char a_BeaconLevel);
-
/** Update the beacon. */
void UpdateBeacon(void);
/** Give the near-players the effects. */
void GiveEffects(void);
- bool LoadFromJson(const Json::Value & a_Value);
-
- // cBlockEntity overrides:
- virtual void SaveToJson(Json::Value& a_Value) override;
- virtual void SendTo(cClientHandle & a_Client) override;
- virtual bool Tick(float a_Dt, cChunk & a_Chunk) override;
- virtual void UsedBy(cPlayer * a_Player) override;
+ /** Returns true if the block is a diamond block, a golden block, an iron block or an emerald block. */
+ static bool IsMineralBlock(BLOCKTYPE a_BlockType);
+
+ /** Returns true if the potion can be used. */
+ static bool IsValidPotion(cEntityEffect::eType a_Potion, char a_BeaconLevel);
+
+ // tolua_end
protected:
bool m_IsActive;
char m_BeaconLevel;
cEntityEffect::eType m_PrimaryPotion, m_SecondaryPotion;
-
-} ;
+} ; // tolua_export