summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-10-03 06:42:38 +0100
committerKHobbits <rob@khobbits.co.uk>2011-10-03 06:42:38 +0100
commit64de3475e5cc48223a4a8f8238eb874aec367546 (patch)
tree61b2f91e2a148d12206b5453454b1e48d96b7f87
parentba67ed976b8e346480c387ce376ab46dd95667c1 (diff)
downloadEssentials-64de3475e5cc48223a4a8f8238eb874aec367546.tar
Essentials-64de3475e5cc48223a4a8f8238eb874aec367546.tar.gz
Essentials-64de3475e5cc48223a4a8f8238eb874aec367546.tar.lz
Essentials-64de3475e5cc48223a4a8f8238eb874aec367546.tar.xz
Essentials-64de3475e5cc48223a4a8f8238eb874aec367546.zip
Fixing mail argument errors.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandmail.java11
1 files 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<String> 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();
}
}