summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-06-10 18:27:55 +0100
committerKHobbits <rob@khobbits.co.uk>2012-06-10 18:27:55 +0100
commitbd83ec0d31b3894f8941b0d6571f1e836f9f4689 (patch)
tree4cec4378ab9422406ba2263e7834d30fc77876ba
parent2be265056735e0a16848a1b4ce41b357f37f8b5a (diff)
downloadEssentials-bd83ec0d31b3894f8941b0d6571f1e836f9f4689.tar
Essentials-bd83ec0d31b3894f8941b0d6571f1e836f9f4689.tar.gz
Essentials-bd83ec0d31b3894f8941b0d6571f1e836f9f4689.tar.lz
Essentials-bd83ec0d31b3894f8941b0d6571f1e836f9f4689.tar.xz
Essentials-bd83ec0d31b3894f8941b0d6571f1e836f9f4689.zip
Fix kits to only show to people who can use them.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkit.java19
1 files changed, 4 insertions, 15 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
index a545adf60..baa8ba014 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
@@ -19,7 +19,8 @@ public class Commandkit extends EssentialsCommand
{
if (args.length < 1)
{
- listKits(user);
+ final String kitList = Kit.listKits(ess, user);
+ user.sendMessage(kitList.length() > 0 ? _("kits", kitList) : _("noKits"));
throw new NoChargeException();
}
else if (args.length > 1 && user.isAuthorized("essentials.kit.others"))
@@ -40,7 +41,8 @@ public class Commandkit extends EssentialsCommand
{
if (args.length < 2)
{
- listKits(sender);
+ final String kitList = Kit.listKits(ess, null);
+ sender.sendMessage(kitList.length() > 0 ? _("kits", kitList) : _("noKits"));
throw new NoChargeException();
}
else
@@ -56,19 +58,6 @@ public class Commandkit extends EssentialsCommand
}
}
- private void listKits(CommandSender sender) throws Exception
- {
- final String kitList = Kit.listKits(ess, null);
- if (kitList.length() > 0)
- {
- sender.sendMessage(_("kits", kitList));
- }
- else
- {
- sender.sendMessage(_("noKits"));
- }
- }
-
private void giveKit(User userTo, User userFrom, String kitName) throws Exception
{
final Map<String, Object> kit = ess.getSettings().getKit(kitName);