From 725128e2e0ec8d7cc0ac788b5e52bb2ee12c87f7 Mon Sep 17 00:00:00 2001 From: uf0h Date: Sat, 11 Jul 2020 07:23:55 +0100 Subject: [PATCH] playerNotFound to playerNeverOnServer msg --- .../src/com/earth2me/essentials/commands/Commandunban.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java index ba763b44f..65d4bac64 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java @@ -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); }