abstract public init ( pocketmine\level\ChunkManager $level, |
||
$level | pocketmine\level\ChunkManager | |
$random |
public function __construct(GenerationManager $manager, $levelID, $seed, $class, array $options) { if (!class_exists($class, true) or !is_subclass_of($class, Generator::class)) { throw new \InvalidStateException("Class {$class} does not exists or is not a subclass of Generator"); } $this->levelID = $levelID; $this->seed = $seed; $this->manager = $manager; $this->generator = new $class($options); $this->generator->init($this, new Random($seed)); }
public function initLevel() { $generator = $this->generator; $this->generatorInstance = new $generator($this->provider->getGeneratorOptions()); $this->generatorInstance->init($this, new Random($this->getSeed())); $this->registerGenerator(); }