diff options
author | snowleo <schneeleo@gmail.com> | 2011-07-20 21:36:23 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-07-20 21:36:23 +0200 |
commit | cdff1649c33594c60a2ce5c873c674d363da81b7 (patch) | |
tree | 31ddba641369316782b9de267f9c1bf349706d57 | |
parent | ea3a2f030c03f90292d5dc9291512f83df800879 (diff) | |
download | Essentials-cdff1649c33594c60a2ce5c873c674d363da81b7.tar Essentials-cdff1649c33594c60a2ce5c873c674d363da81b7.tar.gz Essentials-cdff1649c33594c60a2ce5c873c674d363da81b7.tar.lz Essentials-cdff1649c33594c60a2ce5c873c674d363da81b7.tar.xz Essentials-cdff1649c33594c60a2ce5c873c674d363da81b7.zip |
Show player not found message, if no unhidden player is found in /msg
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandmsg.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java index 02b7a6c32..d6b77715f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java @@ -48,10 +48,25 @@ public class Commandmsg extends EssentialsCommand sender.sendMessage(Util.i18n("playerNotFound")); return; } + + int i = 0; + for (Player p : matches) + { + final User u = ess.getUser(p); + if (u.isHidden()) + { + i++; + } + } + if (i == matches.size()) + { + sender.sendMessage(Util.i18n("playerNotFound")); + return; + } charge(sender); for (Player p : matches) - { + { sender.sendMessage(Util.format("msgFormat", translatedMe, p.getDisplayName(), message)); final User u = ess.getUser(p); if (sender instanceof Player && (u.isIgnoredPlayer(((Player)sender).getName()) || u.isHidden())) |