summaryrefslogtreecommitdiffstats
path: root/src/BlockInfo.h
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2018-01-23 22:07:06 +0100
committerAlexander Harkness <me@bearbin.net>2018-01-23 22:07:06 +0100
commitd3a3c6ad2cafd95363f47f7d370a45425525fa35 (patch)
tree2395ab1c30413a7fc828a3f6da9726f9733d8d18 /src/BlockInfo.h
parentFix android build (#4169) (diff)
downloadcuberite-d3a3c6ad2cafd95363f47f7d370a45425525fa35.tar
cuberite-d3a3c6ad2cafd95363f47f7d370a45425525fa35.tar.gz
cuberite-d3a3c6ad2cafd95363f47f7d370a45425525fa35.tar.bz2
cuberite-d3a3c6ad2cafd95363f47f7d370a45425525fa35.tar.lz
cuberite-d3a3c6ad2cafd95363f47f7d370a45425525fa35.tar.xz
cuberite-d3a3c6ad2cafd95363f47f7d370a45425525fa35.tar.zst
cuberite-d3a3c6ad2cafd95363f47f7d370a45425525fa35.zip
Diffstat (limited to '')
-rw-r--r--src/BlockInfo.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/BlockInfo.h b/src/BlockInfo.h
index e7544bf2d..e8bf9142e 100644
--- a/src/BlockInfo.h
+++ b/src/BlockInfo.h
@@ -43,9 +43,6 @@ public:
/** Does this block disperse sky light? (only relevant for transparent blocks) */
bool m_IsSkylightDispersant;
- /** Can this block hold snow atop? */
- bool m_IsSnowable;
-
/** Is this block solid (player cannot walk through)? */
bool m_IsSolid;
@@ -75,6 +72,9 @@ public:
/** Associated block handler. */
std::unique_ptr<cBlockHandler, sHandlerDeleter> m_Handler;
+ /** The block type associated with this cBlockInfo. Needed for DeprecatedBindings.cpp */
+ BLOCKTYPE m_BlockType;
+
// tolua_begin
inline static NIBBLETYPE GetLightValue (BLOCKTYPE a_Type) { return Get(a_Type).m_LightValue; }
@@ -87,7 +87,14 @@ public:
{
return ((Get(a_Type).m_IsSkylightDispersant) || (Get(a_Type).m_SpreadLightFalloff > 1));
}
- inline static bool IsSnowable (BLOCKTYPE a_Type) { return Get(a_Type).m_IsSnowable; }
+ inline static bool IsSnowable (BLOCKTYPE a_Type)
+ {
+ return (
+ (a_Type == E_BLOCK_ICE)
+ || (a_Type == E_BLOCK_LEAVES)
+ || (!Get(a_Type).m_Transparent && (a_Type != E_BLOCK_PACKED_ICE))
+ );
+ }
inline static bool IsSolid (BLOCKTYPE a_Type) { return Get(a_Type).m_IsSolid; }
inline static bool IsUseableBySpectator (BLOCKTYPE a_Type) { return Get(a_Type).m_UseableBySpectator; }
inline static bool FullyOccupiesVoxel (BLOCKTYPE a_Type) { return Get(a_Type).m_FullyOccupiesVoxel; }
@@ -108,7 +115,6 @@ public:
, m_PistonBreakable(false)
, m_IsRainBlocker(false)
, m_IsSkylightDispersant(false)
- , m_IsSnowable(false)
, m_IsSolid(true)
, m_UseableBySpectator(false)
, m_FullyOccupiesVoxel(false)
@@ -116,6 +122,7 @@ public:
, m_BlockHeight(1.0)
, m_Hardness(0.0f)
, m_Handler()
+ , m_BlockType(E_BLOCK_AIR)
{}
private: