mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-29 14:49:59 +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{
|
public function setPopulated(bool $value = true) : void{
|
||||||
$this->terrainPopulated = $value;
|
$this->terrainPopulated = $value;
|
||||||
|
$this->dirtyFlags |= self::DIRTY_FLAG_TERRAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isGenerated() : bool{
|
public function isGenerated() : bool{
|
||||||
@ -383,6 +384,7 @@ class Chunk{
|
|||||||
|
|
||||||
public function setGenerated(bool $value = true) : void{
|
public function setGenerated(bool $value = true) : void{
|
||||||
$this->terrainGenerated = $value;
|
$this->terrainGenerated = $value;
|
||||||
|
$this->dirtyFlags |= self::DIRTY_FLAG_TERRAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addEntity(Entity $entity) : void{
|
public function addEntity(Entity $entity) : void{
|
||||||
|
@ -101,23 +101,27 @@ class PopulationTask extends AsyncTask{
|
|||||||
$manager->setChunk($chunk->getX(), $chunk->getZ(), $chunk);
|
$manager->setChunk($chunk->getX(), $chunk->getZ(), $chunk);
|
||||||
if(!$chunk->isGenerated()){
|
if(!$chunk->isGenerated()){
|
||||||
$generator->generateChunk($chunk->getX(), $chunk->getZ());
|
$generator->generateChunk($chunk->getX(), $chunk->getZ());
|
||||||
|
$chunk = $manager->getChunk($chunk->getX(), $chunk->getZ());
|
||||||
$chunk->setGenerated();
|
$chunk->setGenerated();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($chunks as $c){
|
foreach($chunks as $i => $c){
|
||||||
$manager->setChunk($c->getX(), $c->getZ(), $c);
|
$manager->setChunk($c->getX(), $c->getZ(), $c);
|
||||||
if(!$c->isGenerated()){
|
if(!$c->isGenerated()){
|
||||||
$generator->generateChunk($c->getX(), $c->getZ());
|
$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());
|
$generator->populateChunk($chunk->getX(), $chunk->getZ());
|
||||||
|
$chunk = $manager->getChunk($chunk->getX(), $chunk->getZ());
|
||||||
|
$chunk->setPopulated();
|
||||||
|
|
||||||
$chunk->recalculateHeightMap();
|
$chunk->recalculateHeightMap();
|
||||||
$chunk->populateSkyLight();
|
$chunk->populateSkyLight();
|
||||||
$chunk->setLightPopulated();
|
$chunk->setLightPopulated();
|
||||||
$chunk->setPopulated();
|
|
||||||
$this->chunk = FastChunkSerializer::serialize($chunk);
|
$this->chunk = FastChunkSerializer::serialize($chunk);
|
||||||
|
|
||||||
foreach($chunks as $i => $c){
|
foreach($chunks as $i => $c){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user