public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this, $this); @mkdir($this->getDataFolder()); @mkdir($this->getDataFolder() . "/maps"); $this->saveDefaultConfig(); $this->reloadConfig(); $this->getLogger()->info("§aTNTRun by §6CraftYourBukkit §aloaded."); $this->prefix = $this->getConfig()->get("prefix"); $this->getServer()->getScheduler()->scheduleRepeatingTask(new GameSender($this), 20); $this->getServer()->getScheduler()->scheduleRepeatingTask(new RefreshSigns($this), 20); foreach ($this->getConfig()->getNested("arenas") as $a) { if (!$this->getServer()->getLevelByName($a["name"]) instanceof Level) { $this->deleteDirectory($this->getServer()->getDataPath() . "/worlds/" . $a["name"]); $this->copymap($this->getDataFolder() . "/maps/" . $a["name"], $this->getServer()->getDataPath() . "/worlds/" . $a["name"]); $this->getServer()->loadLevel($a["name"]); } else { $this->getServer()->unloadLevel($this->getServer()->getLevelByName($a["name"])); $this->deleteDirectory($this->getServer()->getDataPath() . "/worlds/" . $a["name"]); $this->copymap($this->getDataFolder() . "/maps/" . $a["name"], $this->getServer()->getDataPath() . "/worlds/" . $a["name"]); $this->getServer()->loadLevel($a["name"]); } } }