diff options
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandmail.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandmail.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java index 8a2787d82..884238393 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java @@ -39,7 +39,7 @@ public class Commandmail extends EssentialsCommand { if (!user.isAuthorized("essentials.mail.send")) { - throw new Exception(_("noMailSendPerm")); + throw new Exception(_("noPerm","essentials.mail.send")); } Player player = server.getPlayer(args[1]); @@ -63,13 +63,15 @@ public class Commandmail extends EssentialsCommand user.sendMessage(_("mailSent")); return; } - if (args.length >= 1 && "sendall".equalsIgnoreCase(args[0])) + if (args.length > 1 && "sendall".equalsIgnoreCase(args[0])) { if (!user.isAuthorized("essentials.mail.sendall")) { - throw new Exception(_("noMailSendPerm")); + throw new Exception(_("noPerm","essentials.mail.sendall")); } - ess.scheduleAsyncDelayedTask(new SendAll(ChatColor.stripColor(user.getDisplayName()) + ": " + getFinalArg(args, 2))); + ess.scheduleAsyncDelayedTask(new SendAll(ChatColor.stripColor(user.getDisplayName()) + ": " + getFinalArg(args, 1))); + user.sendMessage(_("mailSent")); + return; } if (args.length >= 1 && "clear".equalsIgnoreCase(args[0])) { |