getServer()->getPluginManager()->registerEvents($this, $this); if(Utils::getOS() == "win") { $this->git = new Windows($this, $this->getDataFolder()); } elseif(Utils::getOS() == "linux") { $this->git = new Linux($this, $this->getDataFolder()); } elseif(Utils::getOS() == "mac") { $this->git = new Mac($this, $this->getDataFolder()); } } public function onCommand(CommandSender $sender, Command $cmd, $label, array $args){ switch($cmd->getName()){ case 'git': if(count($args) >= 1) { if(isset(self::COMMANDS[$args[0]])) { $cmd = $args[0]; unset($args[0]); $sender->sendMessage($this->git->{self::COMMANDS[$cmd][0]}(implode(" ", $args))); } } break; } return false; } public function getGitClient() { return $this->git; } public function setGitClient(GitClient $client) { $this->git = $client; return $this->git == $client; } }