Esempio n. 1
0
 @QCommand(
     name = "go",
     permission = "QCC.tp.go",
     description = "Teleports you to another player",
     usage = "/go [player]")
 public void go(CommandArgs args) {
   String args0[] = args.getArgs();
   Player bukkitPlayer = (Player) args.getSender();
   Player target = Bukkit.getPlayer(args0[0]);
   if (Bukkit.getServer().getPlayer(args0[0]).isOnline()) {
     bukkitPlayer.teleport(target);
     Util.sendMsg(bukkitPlayer, QCChat.getPhrase("teleported_you_to_player_X") + target.getName());
   } else {
     Util.sendMsg(bukkitPlayer, QCChat.getPhrase("specify_online_username"));
   }
 }
Esempio n. 2
0
 @QCommand(
     name = "get",
     permission = "QCC.tp.get",
     description = "Teleports the specified player to you",
     usage = "/get [player]")
 public void get(CommandArgs args) {
   String args0[] = args.getArgs();
   Player bukkitPlayer = (Player) args.getSender();
   Player target = Bukkit.getPlayer(args0[0]);
   if (target.isOnline()) {
     target.teleport(bukkitPlayer);
     Util.sendMsg(target, QCChat.getPhrase("teleported_you_to_player_X") + bukkitPlayer.getName());
     Util.sendMsg(
         bukkitPlayer, target.getName() + QCChat.getPhrase("X_has_been_teleported_to_you"));
   } else {
     Util.sendMsg(bukkitPlayer, QCChat.getPhrase("specify_online_username"));
   }
 }