コード例 #1
0
ファイル: CommandFetchTask.php プロジェクト: GeenoMC/BuyCraft
 public function onOutput(BuyCraft $main, CommandSender $sender)
 {
     $out = $this->getOutput();
     if (isset($out["payload"]["commands"])) {
         foreach ($this->getOutput()["payload"]["commands"] as $cmd) {
             $p = $cmd["requireOnline"] ? $main->getServer()->getPlayer($cmd["ign"]) : null;
             if (!$cmd["requireOnline"] || $p !== null) {
                 $main->getCommandExecuteTask()->queueCommand(new PackageCommand($cmd));
             }
         }
     }
 }