Java Code Examples for cn.nukkit.command.CommandSender#sendMessage()

The following examples show how to use cn.nukkit.command.CommandSender#sendMessage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RealNameCommand.java    From EssentialsNK with GNU General Public License v3.0 6 votes vote down vote up
public boolean execute(CommandSender sender, String label, String[] args) {
    if (!this.testPermission(sender)) {
        return false;
    }
    if (args.length != 1) {
        this.sendUsage(sender);
        return false;
    }
    Player player = api.getServer().getPlayer(args[0]);
    if (player == null) {
        sender.sendMessage(TextFormat.RED + Language.translate("commands.generic.player.notfound", args[0]));
        return false;
    }
    sender.sendMessage(Language.translate("commands.realname.success", player.getDisplayName(), player.getName()));
    return true;
}
 
Example 2
Source File: MuteCommand.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {

    if (!this.testPermission(sender)) {
        return true;
    }

    if(sender instanceof ConsoleCommandSender){
    	sender.sendMessage(TextFormat.RED + "コンソールはミュートできません。");
    	return true;
    }

    Player p = (Player)sender;

    if(p.mute){
    	p.setMute(false);
    	p.sendImportantMessage(TextFormat.GREEN + "ミュートを解除しました。");
    	return true;
    }else{
    	p.setMute(true);
    	p.sendImportantMessage(TextFormat.RED + "ミュートを有効にしました。");
    	return true;
    }
}
 
Example 3
Source File: SetLangCommand.java    From EconomyAPI with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String label, String[] args) {
	if(!this.plugin.isEnabled()) return false;
	if(!sender.hasPermission("economyapi.command.setlang")){
		sender.sendMessage(TextFormat.RED + "You don't have permission to use this command.");
		return false;
	}
	
	if(args.length < 1){
		sender.sendMessage(TextFormat.RED + "Usage: " + this.getUsage());
		return true;
	}
	String lang = args[0];
	
	// TODO
	return true;
}
 
Example 4
Source File: SeedCommand.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
    if (!this.testPermission(sender)) {
        return true;
    }

    long seed;
    if (sender instanceof Player) {
        seed = ((Player) sender).getLevel().getSeed();
    } else {
        seed = sender.getServer().getDefaultLevel().getSeed();
    }

    sender.sendMessage(new TranslationContainer("commands.seed.success", String.valueOf(seed)));

    return true;
}
 
Example 5
Source File: DefaultGamemodeCommand.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
    if (!this.testPermission(sender)) {
        return true;
    }
    if (args.length == 0) {
        sender.sendMessage(new TranslationContainer("commands.generic.usage", new String[]{this.usageMessage}));
        return false;
    }
    int gameMode = Server.getGamemodeFromString(args[0]);
    if (gameMode != -1) {
        sender.getServer().setPropertyInt("gamemode", gameMode);
        sender.sendMessage(new TranslationContainer("commands.defaultgamemode.success", new String[]{Server.getGamemodeString(gameMode)}));
    } else {
        sender.sendMessage("Unknown game mode"); //
    }
    return true;
}
 
Example 6
Source File: KickCommand.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
    if (!this.testPermission(sender)) {
        return true;
    }
    if (args.length == 0) {
        sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage));
        return false;
    }

    String name = args[0];

    String reason = "";
    for (int i = 1; i < args.length; i++) {
        reason += args[i] + " ";
    }

    if (reason.length() > 0) {
        reason = reason.substring(0, reason.length() - 1);
    }

    Player player = sender.getServer().getPlayer(name);
    if (player != null) {
        player.kick(PlayerKickEvent.Reason.KICKED_BY_ADMIN, reason);
        if (reason.length() >= 1) {
            Command.broadcastCommandMessage(sender, new TranslationContainer("commands.kick.success.reason", player.getName(), reason)
            );
        } else {
            Command.broadcastCommandMessage(sender, new TranslationContainer("commands.kick.success", player.getName()));
        }
    } else {
        sender.sendMessage(new TranslationContainer(TextFormat.RED + "%commands.generic.player.notFound"));
    }

    return true;
}
 
Example 7
Source File: DepthCommand.java    From EssentialsNK with GNU General Public License v3.0 5 votes vote down vote up
public boolean execute(CommandSender sender, String label, String[] args) {
    if (!this.testPermission(sender)) {
        return false;
    }
    if (!this.testIngame(sender)) {
        return false;
    }
    if (args.length != 0) {
        this.sendUsage(sender);
        return false;
    }
    sender.sendMessage(Language.translate("commands.depth.success", String.valueOf(((Player) sender).getFloorY() - 63)));
    return true;
}
 
Example 8
Source File: KickCommand.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
    if (!this.testPermission(sender)) {
        return true;
    }
    if (args.length == 0) {
        sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage));
        return false;
    }

    String name = args[0];

    String reason = "";
    for (int i = 1; i < args.length; i++) {
        reason += args[i] + " ";
    }

    if (reason.length() > 0) {
        reason = reason.substring(0, reason.length() - 1);
    }

    Player player = sender.getServer().getPlayer(name);
    if (player != null) {
        player.kick(PlayerKickEvent.Reason.KICKED_BY_ADMIN, reason);
        if (reason.length() >= 1) {
            Command.broadcastCommandMessage(sender, new TranslationContainer("commands.kick.success.reason", new String[]{player.getName(), reason})
            );
        } else {
            Command.broadcastCommandMessage(sender, new TranslationContainer("commands.kick.success", player.getName()));
        }
    } else {
        sender.sendMessage(new TranslationContainer(TextFormat.RED + "%commands.generic.player.notFound"));
    }

    return true;
}
 
Example 9
Source File: PluginsCommand.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
private void sendPluginList(CommandSender sender) {
    String list = "";
    Map<String, Plugin> plugins = sender.getServer().getPluginManager().getPlugins();
    for (Plugin plugin : plugins.values()) {
        if (list.length() > 0) {
            list += TextFormat.WHITE + ", ";
        }
        list += plugin.isEnabled() ? TextFormat.GREEN : TextFormat.RED;
        list += plugin.getDescription().getFullName();
    }

    sender.sendMessage(new TranslationContainer("nukkit.command.plugins.success", String.valueOf(plugins.size()), list));
}
 
Example 10
Source File: MeCommand.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
    if (!this.testPermission(sender)) {
        return true;
    }

    if (args.length == 0) {
        sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage));

        return false;
    }

    String name;
    if (sender instanceof Player) {
        name = ((Player) sender).getDisplayName();
    } else {
        name = sender.getName();
    }

    String msg = "";
    for (String arg : args) {
        msg += arg + " ";
    }

    if (msg.length() > 0) {
        msg = msg.substring(0, msg.length() - 1);
    }

    sender.getServer().broadcastMessage(new TranslationContainer("chat.type.emote", new String[]{name, TextFormat.WHITE + msg}));

    return true;
}
 
Example 11
Source File: SimpleCommand.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
public void sendInGameMessage(CommandSender sender) {
    sender.sendMessage(new TranslationContainer("commands.generic.ingame"));
}
 
Example 12
Source File: SimpleCommand.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public void sendInGameMessage(CommandSender sender) {
    sender.sendMessage(new TranslationContainer("commands.generic.ingame"));
}
 
Example 13
Source File: WeatherCommand.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
    if (!this.testPermission(sender)) {
        return true;
    }
    if (args.length == 0 || args.length > 2) {
        sender.sendMessage(new TranslationContainer("commands.weather.usage", this.usageMessage));
        return false;
    }

    String weather = args[0];
    Level level;
    int seconds;
    if (args.length > 1) {
        try {
            seconds = Integer.parseInt(args[1]);
        } catch (Exception e) {
            sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage));
            return true;
        }
    } else {
        seconds = 600 * 20;
    }

    if (sender instanceof Player) {
        level = ((Player) sender).getLevel();
    } else {
        level = sender.getServer().getDefaultLevel();
    }

    switch (weather) {
        case "clear":
            level.setRaining(false);
            level.setThundering(false);
            level.setRainTime(seconds * 20);
            level.setThunderTime(seconds * 20);
            Command.broadcastCommandMessage(sender,
                    new TranslationContainer("commands.weather.clear"));
            return true;
        case "rain":
            level.setRaining(true);
            level.setRainTime(seconds * 20);
            Command.broadcastCommandMessage(sender,
                    new TranslationContainer("commands.weather.rain"));
            return true;
        case "thunder":
            level.setThundering(true);
            level.setRainTime(seconds * 20);
            level.setThunderTime(seconds * 20);
            Command.broadcastCommandMessage(sender,
                    new TranslationContainer("commands.weather.thunder"));
            return true;
        default:
            sender.sendMessage(new TranslationContainer("commands.weather.usage", this.usageMessage));
            return false;
    }

}
 
Example 14
Source File: WhitelistCommand.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
    if (!this.testPermission(sender)) {
        return true;
    }

    if (args.length == 0 || args.length > 2) {
        sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage));
        return true;
    }

    if (args.length == 1) {
        if (this.badPerm(sender, args[0].toLowerCase())) {
            return false;
        }
        switch (args[0].toLowerCase()) {
            case "reload":
                sender.getServer().reloadWhitelist();
                Command.broadcastCommandMessage(sender, new TranslationContainer("commands.whitelist.reloaded"));

                return true;
            case "on":
                sender.getServer().setPropertyBoolean("white-list", true);
                Command.broadcastCommandMessage(sender, new TranslationContainer("commands.whitelist.enabled"));

                return true;
            case "off":
                sender.getServer().setPropertyBoolean("white-list", false);
                Command.broadcastCommandMessage(sender, new TranslationContainer("commands.whitelist.disabled"));

                return true;
            case "list":
                String result = "";
                int count = 0;
                for (String player : sender.getServer().getWhitelist().getAll().keySet()) {
                    result += player + ", ";
                    ++count;
                }
                sender.sendMessage(new TranslationContainer("commands.whitelist.list", new String[]{String.valueOf(count), String.valueOf(count)}));
                sender.sendMessage(result.length() > 0 ? result.substring(0, result.length() - 2) : "");

                return true;

            case "add":
                sender.sendMessage(new TranslationContainer("commands.generic.usage", "%commands.whitelist.add.usage"));
                return true;

            case "remove":
                sender.sendMessage(new TranslationContainer("commands.generic.usage", "%commands.whitelist.remove.usage"));
                return true;
        }
    } else if (args.length == 2) {
        if (this.badPerm(sender, args[0].toLowerCase())) {
            return false;
        }
        switch (args[0].toLowerCase()) {
            case "add":
                sender.getServer().getOfflinePlayer(args[1]).setWhitelisted(true);
                Command.broadcastCommandMessage(sender, new TranslationContainer("commands.whitelist.add.success", args[1]));

                return true;
            case "remove":
                sender.getServer().getOfflinePlayer(args[1]).setWhitelisted(false);
                Command.broadcastCommandMessage(sender, new TranslationContainer("commands.whitelist.remove.success", args[1]));

                return true;
        }
    }

    return true;
}
 
Example 15
Source File: StopSoundCommand.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {

       if (!this.testPermission(sender)) {
           return true;
       }

       if (args.length < 2) {
           sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage));
           return true;
       }

       Player[] players = new Player[]{};

       if (args[0].equals("@e") || args[0].equals("@a")) {
           players = sender.getServer().getOnlinePlayers().values().toArray(new Player[0]);

       } else if (args[0].equals("@p") || args[0].equals("@s")) {
           if (sender instanceof ConsoleCommandSender) {
               sender.sendMessage(new TranslationContainer("commands.generic.ingame"));
               return true;
           } else {//TODO: CommandBlockCommandSender
               players = new Player[]{(Player) sender};
           }

       } else if (args[0].equals("@r")) {
           List<Player> list = Arrays.asList(sender.getServer().getOnlinePlayers().values().toArray(new Player[0]));
           if (list.size() <= 0) {
               sender.sendMessage(new TranslationContainer(TextFormat.RED + "%commands.generic.player.notFound"));
               return true;
           }
           Collections.shuffle(list);
           players = new Player[]{list.get(0)};

       } else {
           if (sender.getServer().getPlayer(args[0]) == null) {
               sender.sendMessage(new TranslationContainer(TextFormat.RED + "%commands.generic.player.notFound"));
               return true;
           }
           players = new Player[]{sender.getServer().getPlayer(args[0])};

       }

       String sound = args[1];
       
       Arrays.asList(players).forEach(p -> {
           StopSoundPacket pk = new StopSoundPacket();
           pk.name = sound;
           pk.stopAll = false;
           p.dataPacket(pk);
       });

	return false;
}
 
Example 16
Source File: TimingsCommand.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
    if (!this.testPermission(sender)) {
        return true;
    }

    if (args.length != 1) {
        sender.sendMessage(new TranslationContainer("commands.generic.usage", usageMessage));
        return true;
    }

    String mode = args[0].toLowerCase();

    if (mode.equals("on")) {
        Timings.setTimingsEnabled(true);
        Timings.reset();
        sender.sendMessage(new TranslationContainer("nukkit.command.timings.enable"));
        return true;
    } else if (mode.equals("off")) {
        Timings.setTimingsEnabled(false);
        sender.sendMessage(new TranslationContainer("nukkit.command.timings.disable"));
        return true;
    }

    if (!Timings.isTimingsEnabled()) {
        sender.sendMessage(new TranslationContainer("nukkit.command.timings.timingsDisabled"));
        return true;
    }

    switch (mode) {
        case "verbon":
            sender.sendMessage(new TranslationContainer("nukkit.command.timings.verboseEnable"));
            Timings.setVerboseEnabled(true);
            break;
        case "verboff":
            sender.sendMessage(new TranslationContainer("nukkit.command.timings.verboseDisable"));
            Timings.setVerboseEnabled(true);
            break;
        case "reset":
            Timings.reset();
            sender.sendMessage(new TranslationContainer("nukkit.command.timings.reset"));
            break;
        case "report":
        case "paste":
            TimingsExport.reportTimings(sender);
            break;
    }
    return true;
}
 
Example 17
Source File: TeleportCommand.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
    if (!this.testPermission(sender)) {
        return true;
    }
    if (args.length < 1 || args.length > 6) {
        sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage));
        return true;
    }
    CommandSender target;
    CommandSender origin = sender;
    if (args.length == 1 || args.length == 3) {
        if (sender instanceof Player) {
            target = sender;
        } else {
            sender.sendMessage(new TranslationContainer("commands.generic.ingame"));
            return true;
        }
        if (args.length == 1) {
            target = sender.getServer().getPlayer(args[0].replace("@s", sender.getName()));
            if (target == null) {
                sender.sendMessage(TextFormat.RED + "Can't find player " + args[0]);
                return true;
            }
        }
    } else {
        target = sender.getServer().getPlayer(args[0].replace("@s", sender.getName()));
        if (target == null) {
            sender.sendMessage(TextFormat.RED + "Can't find player " + args[0]);
            return true;
        }
        if (args.length == 2) {
            origin = target;
            target = sender.getServer().getPlayer(args[1].replace("@s", sender.getName()));
            if (target == null) {
                sender.sendMessage(TextFormat.RED + "Can't find player " + args[1]);
                return true;
            }
        }
    }
    if (args.length < 3) {
        ((Player) origin).teleport((Player) target, PlayerTeleportEvent.TeleportCause.COMMAND);
        Command.broadcastCommandMessage(sender, new TranslationContainer("commands.tp.success", origin.getName(), target.getName()));
        return true;
    } else if (((Player) target).getLevel() != null) {
        int pos;
        if (args.length == 4 || args.length == 6) {
            pos = 1;
        } else {
            pos = 0;
        }
        double x;
        double y;
        double z;
        double yaw;
        double pitch;
        try {
            x = Double.parseDouble(args[pos++].replace("~", "" + ((Player) target).x));
            y = Double.parseDouble(args[pos++].replace("~", "" + ((Player) target).y));
            z = Double.parseDouble(args[pos++].replace("~", "" + ((Player) target).z));
            yaw = ((Player) target).getYaw();
            pitch = ((Player) target).getPitch();
        } catch (NumberFormatException e1) {
            sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage));
            return true;
        }
        if (y < 0) y = 0;
        if (y > 256) y = 256;
        if (args.length == 6 || (args.length == 5 && pos == 3)) {
            yaw = Integer.parseInt(args[pos++]);
            pitch = Integer.parseInt(args[pos++]);
        }
        ((Player) target).teleport(new Location(x, y, z, yaw, pitch, ((Player) target).getLevel()), PlayerTeleportEvent.TeleportCause.COMMAND);
        Command.broadcastCommandMessage(sender, new TranslationContainer("commands.tp.success.coordinates", target.getName(), String.valueOf(NukkitMath.round(x, 2)), String.valueOf(NukkitMath.round(y, 2)), String.valueOf(NukkitMath.round(z, 2))));
        return true;
    }
    sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage));
    return true;
}
 
Example 18
Source File: PayCommand.java    From EconomyAPI with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String label, String[] args){
	if(!this.plugin.isEnabled()) return false;
	if(!sender.hasPermission("economyapi.command.pay")){
		sender.sendMessage(TextFormat.RED + "You don't have permission to use this command.");
		return false;
	}
	
	if(!(sender instanceof Player)){
		sender.sendMessage(TextFormat.RED + "Please use this command in-game.");
		return true;
	}
	
	if(args.length < 2){
		sender.sendMessage(TextFormat.RED + "Usage: " + this.getUsage());
		return true;
	}
	String player = args[0];
	
	Player p = this.plugin.getServer().getPlayer(player);
	if(p != null){
		player = p.getName();
	}
	try{
		double amount = Double.parseDouble(args[1]);
		
		int result = this.plugin.reduceMoney((Player) sender, amount);
		switch(result){
		case EconomyAPI.RET_INVALID:
		case EconomyAPI.RET_CANCELLED:
			sender.sendMessage(this.plugin.getMessage("pay-failed", sender));
			return true;
		case EconomyAPI.RET_NO_ACCOUNT:
			sender.sendMessage(this.plugin.getMessage("player-never-connected", new String[]{player}, sender));
			return true;
		case EconomyAPI.RET_SUCCESS:
			this.plugin.addMoney(player, amount, true);
			
			sender.sendMessage(this.plugin.getMessage("pay-success", new String[]{Double.toString(amount), player}, sender));
			if(p instanceof Player){
				p.sendMessage(this.plugin.getMessage("money-paid", new String[]{sender.getName(), Double.toString(amount)}, sender));
			}
			return true;
		}
	}catch(NumberFormatException e){
		sender.sendMessage(this.plugin.getMessage("takemoney-must-be-number", sender));
	}
	return true;
}
 
Example 19
Source File: BanIpCommand.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
    if (!this.testPermission(sender)) {
        return true;
    }

    if (args.length == 0) {
        sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage));

        return false;
    }

    String value = args[0];
    String reason = "";
    for (int i = 1; i < args.length; i++) {
        reason += args[i] + " ";
    }

    if (reason.length() > 0) {
        reason = reason.substring(0, reason.length() - 1);
    }

    if (Pattern.matches("^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$", value)) {
        this.processIPBan(value, sender, reason);

        Command.broadcastCommandMessage(sender, new TranslationContainer("commands.banip.success", value));
    } else {
        Player player = sender.getServer().getPlayer(value);
        if (player != null) {
            this.processIPBan(player.getAddress(), sender, reason);

            Command.broadcastCommandMessage(sender, new TranslationContainer("commands.banip.success.players", player.getAddress(), player.getName()));
        } else {
            String name = value.toLowerCase();
            String path = sender.getServer().getDataPath() + "players/";
            File file = new File(path + name + ".dat");
            CompoundTag nbt = null;
            if (file.exists()) {
                try {
                    nbt = NBTIO.readCompressed(new FileInputStream(file));
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            if (nbt != null && nbt.contains("lastIP") && Pattern.matches("^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$", (value = nbt.getString("lastIP")))) {
                this.processIPBan(value, sender, reason);

                Command.broadcastCommandMessage(sender, new TranslationContainer("commands.banip.success", value));
            } else {
                sender.sendMessage(new TranslationContainer("commands.banip.invalid"));
                return false;
            }
        }
    }

    return true;
}
 
Example 20
Source File: BanListCommand.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
    if (!this.testPermission(sender)) {
        return true;
    }

    BanList list;
    boolean ips = false;
    if (args.length > 0) {
        switch (args[0].toLowerCase()) {
            case "ips":
                list = sender.getServer().getIPBans();
                ips = true;
                break;
            case "players":
                list = sender.getServer().getNameBans();
                break;
            default:
                sender.sendMessage(new TranslationContainer("commands.generic.usage", this.usageMessage));
                return false;
        }
    } else {
        list = sender.getServer().getNameBans();
    }

    StringBuilder builder = new StringBuilder();
    Iterator<BanEntry> itr = list.getEntires().values().iterator();
    while (itr.hasNext()) {
        builder.append(itr.next().getName());
        if (itr.hasNext()) {
            builder.append(", ");
        }
    }

    if (ips) {
        sender.sendMessage(new TranslationContainer("commands.banlist.ips", String.valueOf(list.getEntires().size())));
    } else {
        sender.sendMessage(new TranslationContainer("commands.banlist.players", String.valueOf(list.getEntires().size())));
    }
    sender.sendMessage(builder.toString());
    return true;
}