Merge branch 'release/3.0' into release/3.1

This commit is contained in:
Dylan K. Taylor 2018-07-17 10:12:52 +01:00
commit 6f00a30ad7

View File

@ -2943,20 +2943,19 @@ class Level implements ChunkManager, Metadatable{
} }
if($populate){ if($populate){
if(!isset($this->chunkPopulationQueue[$index])){ $this->chunkPopulationQueue[$index] = true;
$this->chunkPopulationQueue[$index] = true; for($xx = -1; $xx <= 1; ++$xx){
for($xx = -1; $xx <= 1; ++$xx){ for($zz = -1; $zz <= 1; ++$zz){
for($zz = -1; $zz <= 1; ++$zz){ $this->chunkPopulationLock[Level::chunkHash($x + $xx, $z + $zz)] = true;
$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(); Timings::$populationTimer->stopTiming();