예제 #1
0
 public function command(Command\CommandInterface $command, array $args, CommandSender $sender, CommandSender $room)
 {
     $executor = $command->getExecutor();
     if ($executor instanceof Plugin) {
         return $this->getPlugin($executor->name)->command($command, $sender, $room, $args);
     } else {
         $reflection = new \ReflectionClass($executor);
         if ($reflection->hasMethod("onCommand")) {
             return $executor->onCommand($command, $sender, $room, $args);
         }
     }
     return false;
 }