mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Moved light population to an async task when needed, improved empty chunks
This commit is contained in:
@ -70,6 +70,7 @@ use pocketmine\level\generator\GenerationTask;
|
||||
use pocketmine\level\generator\Generator;
|
||||
use pocketmine\level\generator\GeneratorRegisterTask;
|
||||
use pocketmine\level\generator\GeneratorUnregisterTask;
|
||||
use pocketmine\level\generator\LightPopulationTask;
|
||||
use pocketmine\level\generator\PopulationTask;
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Math;
|
||||
@ -2299,6 +2300,10 @@ class Level implements ChunkManager, Metadatable{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!$chunk->isLightPopulated() and $chunk->isPopulated()){
|
||||
$this->getServer()->getScheduler()->scheduleAsyncTask(new LightPopulationTask($this, $chunk));
|
||||
}
|
||||
|
||||
if($this->isChunkInUse($x, $z)){
|
||||
foreach($this->getChunkLoaders($x, $z) as $loader){
|
||||
$loader->onChunkLoaded($chunk);
|
||||
|
Reference in New Issue
Block a user