Command cleanup

This commit is contained in:
KHobbits 2011-11-18 12:06:59 +00:00
parent e5c77c1aeb
commit e54d73704e
36 changed files with 165 additions and 162 deletions

View file

@ -21,21 +21,21 @@ public class Commandbanip extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
final User u = ess.getUser(args[0]);
final User player = ess.getUser(args[0]);
if (u == null)
if (player == null)
{
ess.getServer().banIP(args[0]);
sender.sendMessage(Util.i18n("banIpAddress"));
}
else
{
final String ipAddress = u.getLastLoginAddress();
final String ipAddress = player.getLastLoginAddress();
if (ipAddress.length() == 0)
{
throw new Exception(Util.i18n("playerNotFound"));
}
ess.getServer().banIP(u.getLastLoginAddress());
ess.getServer().banIP(player.getLastLoginAddress());
sender.sendMessage(Util.i18n("banIpAddress"));
}
}