From b2614e363be2b77aa9163bca94f0bee06a2e6ea6 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 3 Oct 2011 06:42:38 +0100 Subject: [PATCH] Fixing mail argument errors. --- .../com/earth2me/essentials/commands/Commandmail.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java index e08a6c8e5..acffd57a1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java @@ -23,13 +23,15 @@ public class Commandmail extends EssentialsCommand List mail = user.getMails(); if (mail.isEmpty()) { - throw new Exception(Util.i18n("noMail")); + user.sendMessage(Util.i18n("noMail")); + throw new NoChargeException(); } for (String s : mail) { user.sendMessage(s); } - throw new Exception(Util.i18n("mailClear")); + user.sendMessage(Util.i18n("mailClear")); + return; } if (args.length >= 3 && "send".equalsIgnoreCase(args[0])) { @@ -62,8 +64,9 @@ public class Commandmail extends EssentialsCommand if (args.length >= 1 && "clear".equalsIgnoreCase(args[0])) { user.setMails(null); - throw new Exception(Util.i18n("mailCleared")); + user.sendMessage(Util.i18n("mailCleared")); + return; } - throw new NoChargeException(); + throw new NotEnoughArgumentsException(); } }