From 6309c6a97fdbabfde978358f5f9a0f61ab74f91f Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 26 Dec 2017 21:25:57 +0000 Subject: improve rain simulation (#4017) * Uses vanilla logic to decide which blocks rain falls through. * Rain falls infinitely above the world, and stops at y=0. * Entities will now be extinguished if they are under rain-blocking blocks, and fire will now be extinguished by rain similarly. * Create IsWeatherWetAtXYZ to identify wetness at a particular location. * Use new code for enderman rain detection. * Fixes issue #916 * Disable warnings for global constructors in the fire simulator. --- src/BlockInfo.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/BlockInfo.h') diff --git a/src/BlockInfo.h b/src/BlockInfo.h index fd8408638..e7544bf2d 100644 --- a/src/BlockInfo.h +++ b/src/BlockInfo.h @@ -37,7 +37,10 @@ public: /** Can a piston break this block? */ bool m_PistonBreakable; - /** Does a block disperse sky light? (only relevant for transparent blocks) */ + /** Does this block block the passage of rain? */ + bool m_IsRainBlocker; + + /** Does this block disperse sky light? (only relevant for transparent blocks) */ bool m_IsSkylightDispersant; /** Can this block hold snow atop? */ @@ -79,6 +82,7 @@ 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 IsRainBlocker (BLOCKTYPE a_Type) { return Get(a_Type).m_IsRainBlocker; } inline static bool IsSkylightDispersant (BLOCKTYPE a_Type) { return ((Get(a_Type).m_IsSkylightDispersant) || (Get(a_Type).m_SpreadLightFalloff > 1)); @@ -102,6 +106,7 @@ public: , m_Transparent(false) , m_OneHitDig(false) , m_PistonBreakable(false) + , m_IsRainBlocker(false) , m_IsSkylightDispersant(false) , m_IsSnowable(false) , m_IsSolid(true) @@ -149,7 +154,3 @@ inline cBlockHandler * BlockHandler(BLOCKTYPE a_BlockType) { return cBlockInfo::Get(a_BlockType).m_Handler.get(); } - - - - -- cgit v1.2.3