Fix unbanning players who don't have user files.

This commit is contained in:
KHobbits 2011-08-11 04:38:00 +01:00
parent a753f322df
commit 5ca9927987
2 changed files with 13 additions and 4 deletions

View file

@ -252,7 +252,7 @@ public class Util
{
y = 127;
x += 1;
if (x - 16 > loc.getBlockX())
if (x - 32 > loc.getBlockX())
{
throw new Exception(Util.i18n("holeInFloor"));
}

View file

@ -20,9 +20,18 @@ public class Commandunban extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
User u = getPlayer(server, args, 0, true);
ess.getBans().unbanByName(u.getName());
String name;
try
{
User u = getPlayer(server, args, 0, true);
name = u.getName();
}
catch (NoSuchFieldException e)
{
name = args[0];
}
ess.getBans().unbanByName(name);
sender.sendMessage(Util.i18n("unbannedPlayer"));
}
}