diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-08 15:39:40 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-08 15:39:40 +0200 |
commit | 9ab5627a393a0b178f13fbba2c39463cfe0675b8 (patch) | |
tree | 1f89501893f02a6e711e5a31868a8acdb4ca7de5 /src/BlockInfo.h | |
parent | d (diff) | |
parent | Shutdown connection when disconnect packet sent (#3999) (diff) | |
download | cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.gz cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.bz2 cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.lz cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.xz cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.zst cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.zip |
Diffstat (limited to 'src/BlockInfo.h')
-rw-r--r-- | src/BlockInfo.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/BlockInfo.h b/src/BlockInfo.h index 1ba818cb3..fd8408638 100644 --- a/src/BlockInfo.h +++ b/src/BlockInfo.h @@ -28,7 +28,7 @@ public: /** How much light do the blocks consume? */ NIBBLETYPE m_SpreadLightFalloff; - /** Is a block completely transparent? (light doesn't get decreased(?)) */ + /** Is a block transparent? (https://minecraft.gamepedia.com/Opacity) */ bool m_Transparent; /** Is a block destroyed after a single hit? */ @@ -37,6 +37,9 @@ public: /** Can a piston break this block? */ bool m_PistonBreakable; + /** Does a block disperse sky light? (only relevant for transparent blocks) */ + bool m_IsSkylightDispersant; + /** Can this block hold snow atop? */ bool m_IsSnowable; @@ -76,6 +79,10 @@ public: inline static bool IsTransparent (BLOCKTYPE a_Type) { return Get(a_Type).m_Transparent; } inline static bool IsOneHitDig (BLOCKTYPE a_Type) { return Get(a_Type).m_OneHitDig; } inline static bool IsPistonBreakable (BLOCKTYPE a_Type) { return Get(a_Type).m_PistonBreakable; } + inline static bool IsSkylightDispersant (BLOCKTYPE a_Type) + { + 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 IsSolid (BLOCKTYPE a_Type) { return Get(a_Type).m_IsSolid; } inline static bool IsUseableBySpectator (BLOCKTYPE a_Type) { return Get(a_Type).m_UseableBySpectator; } @@ -95,6 +102,7 @@ public: , m_Transparent(false) , m_OneHitDig(false) , m_PistonBreakable(false) + , m_IsSkylightDispersant(false) , m_IsSnowable(false) , m_IsSolid(true) , m_UseableBySpectator(false) |