diff --git a/src/pocketmine/block/BlockFactory.php b/src/pocketmine/block/BlockFactory.php index 9276e3f74..f65538279 100644 --- a/src/pocketmine/block/BlockFactory.php +++ b/src/pocketmine/block/BlockFactory.php @@ -330,6 +330,10 @@ class BlockFactory{ } } + public static function isInit() : bool{ + return self::$fullList !== null; + } + /** * Registers a block type into the index. Plugins may use this method to register new block types or override * existing ones. diff --git a/src/pocketmine/level/light/LightPopulationTask.php b/src/pocketmine/level/light/LightPopulationTask.php index 201d52d41..6a7ab7a85 100644 --- a/src/pocketmine/level/light/LightPopulationTask.php +++ b/src/pocketmine/level/light/LightPopulationTask.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace pocketmine\level\light; +use pocketmine\block\BlockFactory; use pocketmine\level\format\Chunk; use pocketmine\level\Level; use pocketmine\scheduler\AsyncTask; @@ -39,6 +40,9 @@ class LightPopulationTask extends AsyncTask{ } public function onRun(){ + if(!BlockFactory::isInit()){ + BlockFactory::init(); + } /** @var Chunk $chunk */ $chunk = Chunk::fastDeserialize($this->chunk);