mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Level: use block directly in updateBlockSkyLight()
This commit is contained in:
parent
48a5eeb3a4
commit
ef038d9625
@ -1404,14 +1404,14 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$this->timings->doBlockSkyLightUpdates->startTiming();
|
$this->timings->doBlockSkyLightUpdates->startTiming();
|
||||||
|
|
||||||
$oldHeightMap = $this->getHeightMap($x, $z);
|
$oldHeightMap = $this->getHeightMap($x, $z);
|
||||||
$sourceId = $this->getBlockIdAt($x, $y, $z);
|
$source = $this->getBlockAt($x, $y, $z);
|
||||||
|
|
||||||
$yPlusOne = $y + 1;
|
$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.
|
if($yPlusOne === $oldHeightMap){ //Block changed directly beneath the heightmap. Check if a block was removed or changed to a different light-filter.
|
||||||
$newHeightMap = $this->getChunk($x >> 4, $z >> 4)->recalculateHeightMapColumn($x & 0x0f, $z & 0x0f);
|
$newHeightMap = $this->getChunk($x >> 4, $z >> 4)->recalculateHeightMapColumn($x & 0x0f, $z & 0x0f);
|
||||||
}elseif($yPlusOne > $oldHeightMap){ //Block changed above the heightmap.
|
}elseif($yPlusOne > $oldHeightMap){ //Block changed above the heightmap.
|
||||||
if(BlockFactory::$lightFilter[$sourceId] > 1 or BlockFactory::$diffusesSkyLight[$sourceId]){
|
if($source->getLightFilter() > 0 or $source->diffusesSkyLight()){
|
||||||
$this->setHeightMap($x, $z, $yPlusOne);
|
$this->setHeightMap($x, $z, $yPlusOne);
|
||||||
$newHeightMap = $yPlusOne;
|
$newHeightMap = $yPlusOne;
|
||||||
}else{ //Block changed which has no effect on direct sky light, for example placing or removing glass.
|
}else{ //Block changed which has no effect on direct sky light, for example placing or removing glass.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user