From b5a23e5cd9601a8d0779ecf930b84506fbd398d1 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Thu, 7 Sep 2017 11:56:17 +0100 Subject: Lighting now generally consistent with vanilla (#3988) * Lighting now generally consistent with vanilla Skylight is now dispersed by some blocks, instead of passing through unimpeded. Some blocks which were not marked as transparent are now marked as such. Water and other such blocks now attenuate light with the correct intensity. Generally changes were based on documentation in the Minecraft Wiki: https://minecraft.gamepedia.com/Opacity#On_block_light , however during play-testing on vanilla lava was found not to attenuate sky or block-light so the attenuation was removed. This fixes #3849 * Add API documentation for IsSkylightDispersant * Rename m_SkylightDispersant to m_IsSkylightDispersant * Update comment for m_Transparent property of Blocks --- src/LightingThread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/LightingThread.cpp') diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index df1a802a5..302a7ba01 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -378,7 +378,8 @@ void cLightingThread::PrepareSkyLight(void) ASSERT(Current < cChunkDef::Height); while ( (Current >= 0) && - cBlockInfo::IsTransparent(m_BlockTypes[idx + Current * BlocksPerYLayer]) + cBlockInfo::IsTransparent(m_BlockTypes[idx + Current * BlocksPerYLayer]) && + !cBlockInfo::IsSkylightDispersant(m_BlockTypes[idx + Current * BlocksPerYLayer]) ) { Current -= 1; // Sunlight goes down unchanged through this block -- cgit v1.2.3