protected void banIp(MinecraftServer server, ICommandSender sender, String ipAddress, @Nullable String banReason) { UserListIPBansEntry userlistipbansentry = new UserListIPBansEntry(ipAddress, (Date)null, sender.getName(), (Date)null, banReason); server.getPlayerList().getBannedIPs().addEntry(userlistipbansentry); List<EntityPlayerMP> list = server.getPlayerList().getPlayersMatchingAddress(ipAddress); String[] astring = new String[list.size()]; int i = 0; for (EntityPlayerMP entityplayermp : list) { entityplayermp.connection.kickPlayerFromServer("You have been IP banned."); astring[i++] = entityplayermp.getName(); } if (list.isEmpty()) { notifyCommandListener(sender, this, "commands.banip.success", new Object[] {ipAddress}); } else { notifyCommandListener(sender, this, "commands.banip.success.players", new Object[] {ipAddress, joinNiceString(astring)}); } }