summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-08-08 15:34:10 +0200
committersnowleo <schneeleo@gmail.com>2011-08-08 15:34:10 +0200
commita90b16be36ff8fb215993fa6c0d7786375b4b88f (patch)
tree4105e3efe49b8f91d1443378f93b80e945583af5
parentd07ecde47d1125af12624846adc2c669a2bf8574 (diff)
downloadEssentials-a90b16be36ff8fb215993fa6c0d7786375b4b88f.tar
Essentials-a90b16be36ff8fb215993fa6c0d7786375b4b88f.tar.gz
Essentials-a90b16be36ff8fb215993fa6c0d7786375b4b88f.tar.lz
Essentials-a90b16be36ff8fb215993fa6c0d7786375b4b88f.tar.xz
Essentials-a90b16be36ff8fb215993fa6c0d7786375b4b88f.zip
Prevent muted players from using /msg
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandmsg.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java
index d6b77715f..42f17bed2 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java
@@ -25,6 +25,16 @@ public class Commandmsg extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
+ if (sender instanceof Player)
+ {
+ User user = ess.getUser(sender);
+ if (user.isMuted())
+ {
+ user.sendMessage(Util.i18n("voiceSilenced"));
+ return;
+ }
+ }
+
String message = getFinalArg(args, 1);
String translatedMe = Util.i18n("me");
@@ -48,7 +58,7 @@ public class Commandmsg extends EssentialsCommand
sender.sendMessage(Util.i18n("playerNotFound"));
return;
}
-
+
int i = 0;
for (Player p : matches)
{