playerNotFound to playerNeverOnServer msg

This commit is contained in:
uf0h 2020-07-11 07:23:55 +01:00
parent 309e1c470d
commit 725128e2e0
1 changed files with 3 additions and 2 deletions

View File

@ -22,16 +22,17 @@ public class Commandunban extends EssentialsCommand {
if (args.length < 1) {
throw new NotEnoughArgumentsException();
}
String name;
try {
final User user = getPlayer(server, args, 0, true, true);
name = user.getName();
ess.getServer().getBanList(BanList.Type.NAME).pardon(name);
} catch (NoSuchFieldException e) {
} catch (PlayerNotFoundException e) {
final OfflinePlayer player = server.getOfflinePlayer(args[0]);
name = player.getName();
if (!player.isBanned()) {
throw new Exception(tl("playerNotFound"), e);
throw new Exception(tl("playerNeverOnServer", args[0]));
}
ess.getServer().getBanList(BanList.Type.NAME).pardon(name);
}