World->populateChunk() no longer causes ChunkLoadEvent to fire with an empty chunk

instead, it will fire when the chunk comes out of PopulationTask and is set into the world using setChunk().
There is still one place left where auto-creation of empty chunks is used by the core, and that's an issue i'm still deciding how to deal with.
This commit is contained in:
Dylan K. Taylor 2020-12-03 18:23:03 +00:00
parent fa9be2477d
commit ec2feeffcb

View File

@ -2513,7 +2513,10 @@ class World implements ChunkManager{
} }
} }
$chunk = $this->loadChunk($x, $z, true); $chunk = $this->loadChunk($x, $z, false);
if($chunk === null){
$chunk = new Chunk($x, $z);
}
if(!$chunk->isPopulated()){ if(!$chunk->isPopulated()){
Timings::$populationTimer->startTiming(); Timings::$populationTimer->startTiming();