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
commit2e15de483d5afd8a1de0ccaaac0abd643677c93a (patch)
tree107181c8384a80fb4d6342d6c339a3c4e906c4b7
parent77b0415c1bbb68144201f1ed5de5aa51fb0afcd7 (diff)
downloadEssentials-2e15de483d5afd8a1de0ccaaac0abd643677c93a.tar
Essentials-2e15de483d5afd8a1de0ccaaac0abd643677c93a.tar.gz
Essentials-2e15de483d5afd8a1de0ccaaac0abd643677c93a.tar.lz
Essentials-2e15de483d5afd8a1de0ccaaac0abd643677c93a.tar.xz
Essentials-2e15de483d5afd8a1de0ccaaac0abd643677c93a.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"));
+ }
}
}