Updating banip to support offline players.

This commit is contained in:
KHobbits 2011-11-15 23:01:15 +00:00
parent eda827b244
commit f51b92c99e

View file

@ -30,7 +30,11 @@ public class Commandbanip extends EssentialsCommand
} }
else else
{ {
ess.getServer().banIP(u.getAddress().getAddress().getHostAddress()); final String ipAddress = u.getLastLoginAddress();
if (ipAddress.length() == 0) {
throw new Exception(Util.i18n("playerNotFound"));
}
ess.getServer().banIP(u.getLastLoginAddress());
sender.sendMessage(Util.i18n("banIpAddress")); sender.sendMessage(Util.i18n("banIpAddress"));
} }
} }