Ejemplo n.º 1
0
 public function onRun(array $args, Faction $faction, Player $player)
 {
     // TODO find the correct named home
     if (isset($args[0])) {
         $home = $faction->getHome($args[0]);
         if ($home instanceof Position) {
             $player->teleport($home);
             return "You have been teleported to {$args['0']}.";
         }
         return "There is no such home named \"{$args['0']}\"!";
     }
     $home = $faction->getHome();
     if ($home instanceof Position) {
         $player->teleport($home);
         return "You have been teleported to your faction home.";
     }
     return "Your faction doesn't seem to have a home.";
 }