Chunk no longer depends on BlockFactory

really this light population crap shouldn't be in the chunk to begin with, but that's a bit more complicated.
This commit is contained in:
Dylan K. Taylor
2020-04-23 21:31:28 +01:00
parent aa1828aa98
commit accc0da0cb
4 changed files with 24 additions and 12 deletions

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace pocketmine\world\generator;
use pocketmine\block\BlockFactory;
use pocketmine\scheduler\AsyncTask;
use pocketmine\world\format\Chunk;
use pocketmine\world\format\io\FastChunkSerializer;
@ -118,8 +119,8 @@ class PopulationTask extends AsyncTask{
$chunk = $manager->getChunk($chunk->getX(), $chunk->getZ());
$chunk->setPopulated();
$chunk->recalculateHeightMap();
$chunk->populateSkyLight();
$chunk->recalculateHeightMap(BlockFactory::$lightFilter, BlockFactory::$diffusesSkyLight);
$chunk->populateSkyLight(BlockFactory::$lightFilter);
$chunk->setLightPopulated();
$this->chunk = FastChunkSerializer::serialize($chunk);