Chunk no longer depends on BlockFactory

really this light population crap shouldn't be in the chunk to begin with, but that's a bit more complicated.
This commit is contained in:
Dylan K. Taylor
2020-04-23 21:31:28 +01:00
parent aa1828aa98
commit accc0da0cb
4 changed files with 24 additions and 12 deletions

View File

@ -51,7 +51,7 @@ class SkyLightUpdate extends LightUpdate{
$yPlusOne = $y + 1;
if($yPlusOne === $oldHeightMap){ //Block changed directly beneath the heightmap. Check if a block was removed or changed to a different light-filter.
$newHeightMap = $chunk->recalculateHeightMapColumn($x & 0x0f, $z & 0x0f);
$newHeightMap = $chunk->recalculateHeightMapColumn($x & 0x0f, $z & 0x0f, BlockFactory::$lightFilter, BlockFactory::$diffusesSkyLight);
}elseif($yPlusOne > $oldHeightMap){ //Block changed above the heightmap.
if($source->getLightFilter() > 0 or $source->diffusesSkyLight()){
$chunk->setHeightMap($x & 0xf, $z & 0xf, $yPlusOne);