summaryrefslogtreecommitdiffstats
path: root/src/BlockInfo.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-03-02 22:03:44 +0100
committerMattes D <github@xoft.cz>2014-03-02 22:03:44 +0100
commitd25e4d4179c00f1692c4d348baece49561c49938 (patch)
treec180208ae9759403cc29c4784103569793e6cc63 /src/BlockInfo.h
parentFixed MSVC warnings in DeprecatedBindings. (diff)
parentRemoved if condition (diff)
downloadcuberite-d25e4d4179c00f1692c4d348baece49561c49938.tar
cuberite-d25e4d4179c00f1692c4d348baece49561c49938.tar.gz
cuberite-d25e4d4179c00f1692c4d348baece49561c49938.tar.bz2
cuberite-d25e4d4179c00f1692c4d348baece49561c49938.tar.lz
cuberite-d25e4d4179c00f1692c4d348baece49561c49938.tar.xz
cuberite-d25e4d4179c00f1692c4d348baece49561c49938.tar.zst
cuberite-d25e4d4179c00f1692c4d348baece49561c49938.zip
Diffstat (limited to 'src/BlockInfo.h')
-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;
+}
+
+
+
+