private function initModules() { echo "Initializing levels..."; $this->resetLine(true); Settings::init($this->getServer()); echo "Initializing module: " . "KitPvP"; $this->games[Session::SESSION_GAME_KITPVP] = new PvpGame($this); $this->resetLine(); echo "Initializing module: " . TextFormat::AQUA . "Parkour\r" . TextFormat::WHITE; $this->games[Session::SESSION_GAME_PARKOUR] = new ParkourGame($this); $this->resetLine(); echo "Initializing module: " . TextFormat::AQUA . "Spleef\r" . TextFormat::WHITE; $this->games[Session::SESSION_GAME_SPLEEF] = new SpleefGame($this); $this->resetLine(); // echo "Initializing module: " . TextFormat::AQUA . "Infected\r" . TextFormat::WHITE; // $this->games[Session::SESSION_GAME_INFECTED] = new InfectedGame($this); // $this->resetLine(); echo "Registering minigame commands..."; $this->resetLine(); $cmds = []; foreach ($this->games as $game) { foreach ($game->getDefaultCommands() as $cmd) { if (!isset($cmd["aliases"])) { $cmd["aliases"] = []; } $cmd["game"] = $game->getName(); if (isset($cmds[$cmd["name"]])) { $cmd["description"] .= "\n" . $cmds[$cmd["name"]]["description"]; $cmd["usage"] .= "\n" . $cmds[$cmd["name"]]["usage"]; $cmd["aliases"] = array_merge($cmd["aliases"], $cmds[$cmd["name"]]["aliases"]); } $cmds[$cmd["name"]] = $cmd; } } foreach ($cmds as $cmd) { $this->getServer()->getCommandMap()->register("legionpe", new oldSessionCommand($this, $cmd["name"], $cmd["description"], $cmd["usage"], $cmd["aliases"])); } }