public function __construct(SurvivalGames $plugin, $name, array $data) { parent::__construct($this); $this->plugin = $plugin; $this->name = $name; $this->data = $data; $this->positions = array_fill(1, count($this->getSpawnPositions()), null); $this->msg = $this->plugin->messagesManager; $this->plugin->getServer()->loadLevel($this->data["world"]); $this->findChests(); $this->plugin->getServer()->getScheduler()->scheduleRepeatingTask(new ArenaSchedule($this), 20); foreach (SurvivalGames::$cfg["block"]["place"]["whitelist"] as $block) { $this->placeList[] = $block; } foreach (SurvivalGames::$cfg["block"]["break"]["whitelist"] as $block) { $this->breakList[] = $block; } //game level $name = $data["world"]; if (!$this->plugin->getServer()->isLevelLoaded($name)) { $this->plugin->getServer()->loadLevel($name); } $this->level = $this->plugin->getServer()->getLevelByName($name); //sign level $name = $data["join_sign"]["world"]; if (!$this->plugin->getServer()->isLevelLoaded($name)) { $this->plugin->getServer()->loadLevel($name); } $this->lobbyLevel = $this->plugin->getServer()->getLevelByName($name); }
public function __construct(SurvivalGames $plugin, $name, $data) { parent::__construct($this); $this->plugin = $plugin; $this->name = $name; $this->data = $data; $this->positions = array_fill(1, count($this->getSpawnPositions()), 0); $this->msg = $this->plugin->messagesManager; $this->plugin->getServer()->loadLevel($this->data["world"]); $this->findChests(); $this->plugin->getServer()->getScheduler()->scheduleRepeatingTask(new ArenaSchedule($this), 20); }