1
0

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
This commit is contained in:
Alexander Harkness
2017-09-07 11:56:17 +01:00
committed by GitHub
parent dc294cdc51
commit b5a23e5cd9
4 changed files with 86 additions and 14 deletions

View File

@@ -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