private void displayCommand(Command c, Player p) {
   p.sendMessage("-------------Command Arguments---------------");
   p.sendMessage("--------------------------------------------");
   for (Argument arg : c.listArguments()) {
     p.sendMessage(arg.toString());
   }
 }
 @Override
 public void execute(final Player p, final String[] args) {
   if (args.length != 1) {
     p.sendMessage("§c/team ff <on/off>");
     return;
   }
   if (!TeamManager.getInstance().isOnTeam(p.getName())) {
     p.sendMessage("§cYou are not on a team.");
     return;
   }
   if (!TeamManager.getInstance().isLeader(p) && !TeamManager.getInstance().isManager(p)) {
     p.sendMessage("§cYou must be at least a manager to perform this command.");
     return;
   }
   final Team team = TeamManager.getInstance().getPlayerTeam(p);
   if (args[0].equalsIgnoreCase("on") || args[0].equalsIgnoreCase("true")) {
     if (team.isFriendlyFire()) {
       p.sendMessage("§eFriendly fire is already turned on!");
       return;
     }
     team.setFriendlyFire(true);
     TeamManager.getInstance()
         .messageTeam(team, "§6" + p.getName() + " §ehas §cenabled §efriendly fire!");
   } else {
     if (!args[0].equalsIgnoreCase("off") && !args[0].equalsIgnoreCase("false")) {
       p.sendMessage("§c/team ff <on/off>");
       return;
     }
     TeamManager.getInstance()
         .messageTeam(team, "§6" + p.getName() + " §ehas §adisabled §efriendly fire!");
   }
 }
  private void displayCategory(Category c, Player p) {
    p.sendMessage("----Available Commands and Sub-Categories----");
    p.sendMessage("-----------------------------------------");
    for (Command com : c.listCommands()) {
      p.sendMessage(com.toString());
    }

    for (Category subCat : c.listCategories()) {
      p.sendMessage(subCat.toString());
    }
  }
Example #4
0
 public static void addSeconds(final Player player, final int seconds) {
   if (!b******g.fdsjfhkdsjfdsjhk().getServerHandler().isEOTW()
       && DTRBitmaskType.SAFE_ZONE.appliesAt(player.getLocation())) {
     return;
   }
   if (isTagged(player)) {
     final int secondsTaggedFor =
         (int)
             ((SpawnTagHandler.spawnTags.get(player.getName()) - System.currentTimeMillis())
                 / 1000L);
     final int newSeconds = Math.min(secondsTaggedFor + seconds, 60);
     SpawnTagHandler.spawnTags.put(
         player.getName(), System.currentTimeMillis() + newSeconds * 1000L);
   } else {
     player.sendMessage(
         ChatColor.YELLOW + "You have been spawn-tagged for §c" + seconds + " §eseconds!");
     SpawnTagHandler.spawnTags.put(player.getName(), System.currentTimeMillis() + seconds * 1000L);
   }
 }