mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 02:09:42 +00:00
Merge branch 'stable'
This commit is contained in:
commit
9b6fa8c25b
@ -375,6 +375,7 @@ class Chunk{
|
||||
|
||||
public function setPopulated(bool $value = true) : void{
|
||||
$this->terrainPopulated = $value;
|
||||
$this->dirtyFlags |= self::DIRTY_FLAG_TERRAIN;
|
||||
}
|
||||
|
||||
public function isGenerated() : bool{
|
||||
@ -383,6 +384,7 @@ class Chunk{
|
||||
|
||||
public function setGenerated(bool $value = true) : void{
|
||||
$this->terrainGenerated = $value;
|
||||
$this->dirtyFlags |= self::DIRTY_FLAG_TERRAIN;
|
||||
}
|
||||
|
||||
public function addEntity(Entity $entity) : void{
|
||||
|
@ -101,23 +101,27 @@ 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->setPopulated();
|
||||
|
||||
$chunk->recalculateHeightMap();
|
||||
$chunk->populateSkyLight();
|
||||
$chunk->setLightPopulated();
|
||||
$chunk->setPopulated();
|
||||
|
||||
$this->chunk = FastChunkSerializer::serialize($chunk);
|
||||
|
||||
foreach($chunks as $i => $c){
|
||||
|
Loading…
x
Reference in New Issue
Block a user