summaryrefslogtreecommitdiffstats
path: root/src/BlockInfo.h
diff options
context:
space:
mode:
authorandrew <xdotftw@gmail.com>2014-03-02 20:25:05 +0100
committerandrew <xdotftw@gmail.com>2014-03-02 20:25:05 +0100
commit070d483236279e69c736e740fa8459d3ac627790 (patch)
treed4431ca58c236556056e041b3d888ea61e7ac144 /src/BlockInfo.h
parentFixed MSVC warnings in DeprecatedBindings. (diff)
downloadcuberite-070d483236279e69c736e740fa8459d3ac627790.tar
cuberite-070d483236279e69c736e740fa8459d3ac627790.tar.gz
cuberite-070d483236279e69c736e740fa8459d3ac627790.tar.bz2
cuberite-070d483236279e69c736e740fa8459d3ac627790.tar.lz
cuberite-070d483236279e69c736e740fa8459d3ac627790.tar.xz
cuberite-070d483236279e69c736e740fa8459d3ac627790.tar.zst
cuberite-070d483236279e69c736e740fa8459d3ac627790.zip
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;
+}
+
+
+
+