mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
LightPopulationTask: Simplify check for chunk loading in onCompletion()
we have no business loading chunks here either, although the isChunkLoaded() check should prevent that from happening.
This commit is contained in:
parent
b252c18d34
commit
ae9e931849
@ -79,9 +79,7 @@ class LightPopulationTask extends AsyncTask{
|
||||
public function onCompletion() : void{
|
||||
/** @var World $world */
|
||||
$world = $this->fetchLocal(self::TLS_KEY_WORLD);
|
||||
if(!$world->isClosed() and $world->isChunkLoaded($this->chunkX, $this->chunkZ)){
|
||||
/** @var Chunk $chunk */
|
||||
$chunk = $world->getOrLoadChunk($this->chunkX, $this->chunkZ);
|
||||
if(!$world->isClosed() and ($chunk = $world->getChunk($this->chunkX, $this->chunkZ)) !== null){
|
||||
//TODO: calculated light information might not be valid if the terrain changed during light calculation
|
||||
|
||||
/** @var int[] $heightMapArray */
|
||||
|
Loading…
x
Reference in New Issue
Block a user