summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-06-11 00:07:22 +0100
committerKHobbits <rob@khobbits.co.uk>2012-06-11 00:07:22 +0100
commit84606b89b51b790efee58a803ba9a87c0f1145c6 (patch)
treecb0952bfe267cf0548d2353724a6b10bdca2376a
parent327ce54bcf9415cb1f277d3d1f94a4654faf634a (diff)
downloadEssentials-84606b89b51b790efee58a803ba9a87c0f1145c6.tar
Essentials-84606b89b51b790efee58a803ba9a87c0f1145c6.tar.gz
Essentials-84606b89b51b790efee58a803ba9a87c0f1145c6.tar.lz
Essentials-84606b89b51b790efee58a803ba9a87c0f1145c6.tar.xz
Essentials-84606b89b51b790efee58a803ba9a87c0f1145c6.zip
Make /whois throw an error if no matching players are found.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandpay.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandwhois.java6
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"));
+ }
}
}