mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 21:45:35 +00:00
World: do not perform base lighting calculation on non-generated chunks
this was causing twice as many light calculations for freshly generated chunks.
This commit is contained in:
parent
ef542880de
commit
2684ee96f7
@ -930,6 +930,13 @@ class World implements ChunkManager{
|
|||||||
$dz = mt_rand(-$randRange, $randRange);
|
$dz = mt_rand(-$randRange, $randRange);
|
||||||
$hash = World::chunkHash($dx + $chunkX, $dz + $chunkZ);
|
$hash = World::chunkHash($dx + $chunkX, $dz + $chunkZ);
|
||||||
if(!isset($chunkTickList[$hash]) and isset($this->chunks[$hash])){
|
if(!isset($chunkTickList[$hash]) and isset($this->chunks[$hash])){
|
||||||
|
if(
|
||||||
|
!$this->chunks[$hash]->isGenerated() ||
|
||||||
|
!$this->chunks[$hash]->isPopulated() ||
|
||||||
|
$this->isChunkLocked($dx + $chunkX, $dz + $chunkZ)
|
||||||
|
){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//TODO: this might need to be checked after adjacent chunks are loaded in future
|
//TODO: this might need to be checked after adjacent chunks are loaded in future
|
||||||
$lightPopulatedState = $this->chunks[$hash]->isLightPopulated();
|
$lightPopulatedState = $this->chunks[$hash]->isLightPopulated();
|
||||||
if($lightPopulatedState !== true){
|
if($lightPopulatedState !== true){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user