From bda2f5e6155cd45020f7c2623085c2e5f05b4dc3 Mon Sep 17 00:00:00 2001 From: snowleo Date: Wed, 20 Jul 2011 21:36:23 +0200 Subject: [PATCH] Show player not found message, if no unhidden player is found in /msg --- .../essentials/commands/Commandmsg.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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()))