mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-20 12:44:01 +00:00
Improved performance of basic chunk sky-light population
No need to recalculate this 256 times
This commit is contained in:
parent
2726f2a011
commit
728851594b
@ -427,13 +427,12 @@ class Chunk{
|
||||
* TODO: fast adjacent light spread
|
||||
*/
|
||||
public function populateSkyLight(){
|
||||
$maxY = ($this->getHighestSubChunkIndex() + 1) << 4;
|
||||
for($x = 0; $x < 16; ++$x){
|
||||
for($z = 0; $z < 16; ++$z){
|
||||
$heightMap = $this->getHeightMap($x, $z);
|
||||
|
||||
$y = ($this->getHighestSubChunkIndex() + 1) << 4;
|
||||
|
||||
for(; $y >= $heightMap; --$y){
|
||||
for($y = $maxY; $y >= $heightMap; --$y){
|
||||
$this->setBlockSkyLight($x, $y, $z, 15);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user