diff options
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandpay.java | 2 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandwhois.java | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java index 01e1fcffb..4a2ac4dde 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java @@ -42,7 +42,7 @@ public class Commandpay extends EssentialsCommand foundUser = true; } - if (foundUser == false) + if (!foundUser) { throw new NoSuchFieldException(_("playerNotFound")); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java index 6c7919163..f7a8ffd6b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java @@ -38,6 +38,7 @@ public class Commandwhois extends EssentialsCommand } final String whois = args[0].toLowerCase(Locale.ENGLISH); final int prefixLength = Util.stripFormat(ess.getSettings().getNicknamePrefix()).length(); + Boolean foundUser = false; for (Player onlinePlayer : server.getOnlinePlayers()) { final User user = ess.getUser(onlinePlayer); @@ -52,6 +53,7 @@ public class Commandwhois extends EssentialsCommand { continue; } + foundUser = true; sender.sendMessage(""); user.setDisplayNick(); sender.sendMessage(_("whoisIs", user.getDisplayName(), user.getName())); @@ -81,5 +83,9 @@ public class Commandwhois extends EssentialsCommand sender.sendMessage(_("whoisGeoLocation", location)); } } + if (!foundUser) + { + throw new NoSuchFieldException(_("playerNotFound")); + } } } |