diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index c15bc19c3..0b61b2ef7 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -2943,20 +2943,19 @@ class Level implements ChunkManager, Metadatable{ } if($populate){ - if(!isset($this->chunkPopulationQueue[$index])){ - $this->chunkPopulationQueue[$index] = true; - for($xx = -1; $xx <= 1; ++$xx){ - for($zz = -1; $zz <= 1; ++$zz){ - $this->chunkPopulationLock[Level::chunkHash($x + $xx, $z + $zz)] = true; - } + $this->chunkPopulationQueue[$index] = true; + for($xx = -1; $xx <= 1; ++$xx){ + for($zz = -1; $zz <= 1; ++$zz){ + $this->chunkPopulationLock[Level::chunkHash($x + $xx, $z + $zz)] = true; } - $task = new PopulationTask($this, $chunk); - $workerId = $this->server->getAsyncPool()->selectWorker(); - if(!isset($this->generatorRegisteredWorkers[$workerId])){ - $this->registerGeneratorToWorker($workerId); - } - $this->server->getAsyncPool()->submitTaskToWorker($task, $workerId); } + + $task = new PopulationTask($this, $chunk); + $workerId = $this->server->getAsyncPool()->selectWorker(); + if(!isset($this->generatorRegisteredWorkers[$workerId])){ + $this->registerGeneratorToWorker($workerId); + } + $this->server->getAsyncPool()->submitTaskToWorker($task, $workerId); } Timings::$populationTimer->stopTiming();