diff options
author | andrew <xdotftw@gmail.com> | 2014-03-02 20:25:05 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-03-02 20:25:05 +0100 |
commit | 070d483236279e69c736e740fa8459d3ac627790 (patch) | |
tree | d4431ca58c236556056e041b3d888ea61e7ac144 /src/BlockInfo.h | |
parent | Fixed MSVC warnings in DeprecatedBindings. (diff) | |
download | cuberite-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 'src/BlockInfo.h')
-rw-r--r-- | src/BlockInfo.h | 27 |
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; +} + + + + |