mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
PopulationTask: fixed chunks being generated empty in flat worlds
the flat generator just clones a pregenerated chunk instead of modifying the provided chunks, which means that the references that population task has would be the outdated ones.
This commit is contained in:
parent
1257378198
commit
398b636759
@ -98,18 +98,21 @@ class PopulationTask extends AsyncTask{
|
||||
$manager->setChunk($chunk->getX(), $chunk->getZ(), $chunk);
|
||||
if(!$chunk->isGenerated()){
|
||||
$generator->generateChunk($chunk->getX(), $chunk->getZ());
|
||||
$chunk = $manager->getChunk($chunk->getX(), $chunk->getZ());
|
||||
$chunk->setGenerated();
|
||||
}
|
||||
|
||||
foreach($chunks as $c){
|
||||
foreach($chunks as $i => $c){
|
||||
$manager->setChunk($c->getX(), $c->getZ(), $c);
|
||||
if(!$c->isGenerated()){
|
||||
$generator->generateChunk($c->getX(), $c->getZ());
|
||||
$c->setGenerated();
|
||||
$chunks[$i] = $manager->getChunk($c->getX(), $c->getZ());
|
||||
$chunks[$i]->setGenerated();
|
||||
}
|
||||
}
|
||||
|
||||
$generator->populateChunk($chunk->getX(), $chunk->getZ());
|
||||
$chunk = $manager->getChunk($chunk->getX(), $chunk->getZ());
|
||||
|
||||
$chunk->recalculateHeightMap();
|
||||
$chunk->populateSkyLight();
|
||||
|
Loading…
x
Reference in New Issue
Block a user