mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Fixed async light population producing garbage when generator isn't registered, closes #2488
This commit is contained in:
parent
196cf8a68d
commit
09985c5763
@ -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.
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user