init() abstract public method

abstract public init ( pocketmine\level\ChunkManager $level, Random $random )
$level pocketmine\level\ChunkManager
$random pocketmine\utils\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));
 }
Ejemplo n.º 2
0
 public function initLevel()
 {
     $generator = $this->generator;
     $this->generatorInstance = new $generator($this->provider->getGeneratorOptions());
     $this->generatorInstance->init($this, new Random($this->getSeed()));
     $this->registerGenerator();
 }