summaryrefslogtreecommitdiffstats
path: root/src/BlockInfo.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/BlockInfo.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/BlockInfo.h b/src/BlockInfo.h
index 34a845b20..40c1db867 100644
--- a/src/BlockInfo.h
+++ b/src/BlockInfo.h
@@ -5,6 +5,13 @@
+// fwd:
+class cBlockHandler;
+
+
+
+
+
// tolua_begin
class cBlockInfo
{
@@ -13,6 +20,8 @@ public:
cBlockInfo();
+ ~cBlockInfo();
+
/** (Re-)Initializes the internal BlockInfo structures. */
static void Initialize(void);
@@ -49,6 +58,12 @@ public:
/** Does this block fully occupy its voxel - is it a 'full' block? */
bool m_FullyOccupiesVoxel;
+ // tolua_end
+
+ /** Associated block handler. */
+ cBlockHandler * m_Handler;
+
+ // tolua_begin
inline static NIBBLETYPE GetLightValue (BLOCKTYPE a_Type) { return Get(a_Type).m_LightValue; }
inline static NIBBLETYPE GetSpreadLightFalloff(BLOCKTYPE a_Type) { return Get(a_Type).m_SpreadLightFalloff; }
@@ -62,6 +77,8 @@ public:
// tolua_end
+ inline static cBlockHandler * GetHandler (BLOCKTYPE a_Type) { return Get(a_Type).m_Handler; }
+
protected:
@@ -74,3 +91,13 @@ protected:
+
+// Shortcut to get the blockhandler for a specific block
+inline cBlockHandler * BlockHandler(BLOCKTYPE a_BlockType)
+{
+ return cBlockInfo::Get(a_BlockType).m_Handler;
+}
+
+
+
+