From 7d0fafd084e11aecb3ac6cca19a6d8f841dcdb31 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 7 Mar 2013 02:57:25 +0000 Subject: [PATCH] Don't check people for meta perms when using kits. --- Essentials/src/com/earth2me/essentials/Kit.java | 2 +- .../src/com/earth2me/essentials/MetaItemStack.java | 6 +----- .../earth2me/essentials/commands/Commandfirework.java | 10 +++++++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index b2eb07373..505ee22af 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -120,7 +120,7 @@ public class Kit if (parts.length > 2) { - metaStack.parseStringMeta(user, allowUnsafe, parts, 2, ess); + metaStack.parseStringMeta(null, allowUnsafe, parts, 2, ess); } final Map overfilled; diff --git a/Essentials/src/com/earth2me/essentials/MetaItemStack.java b/Essentials/src/com/earth2me/essentials/MetaItemStack.java index 0fcb1f6df..e2f95cfbf 100644 --- a/Essentials/src/com/earth2me/essentials/MetaItemStack.java +++ b/Essentials/src/com/earth2me/essentials/MetaItemStack.java @@ -169,7 +169,7 @@ public class MetaItemStack } else { - sender.sendMessage(_("noChapterMeta")); + throw new Exception(_("noChapterMeta")); } } @@ -270,7 +270,6 @@ public class MetaItemStack } else { - sender.sendMessage(_("fireworkSyntax")); throw new Exception(_("invalidFireworkFormat", split[1], split[0])); } } @@ -286,7 +285,6 @@ public class MetaItemStack } else { - sender.sendMessage(_("fireworkSyntax")); throw new Exception(_("invalidFireworkFormat", split[1], split[0])); } if (finalEffect != null) @@ -306,7 +304,6 @@ public class MetaItemStack } else { - sender.sendMessage(_("fireworkSyntax")); throw new Exception(_("invalidFireworkFormat", split[1], split[0])); } } @@ -330,7 +327,6 @@ public class MetaItemStack } else { - sender.sendMessage(_("fireworkSyntax")); throw new Exception(_("invalidFireworkFormat", split[1], split[0])); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java b/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java index 1283ba2af..41a844fbd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java @@ -111,7 +111,15 @@ public class Commandfirework extends EssentialsCommand final MetaItemStack mStack = new MetaItemStack(stack); for (String arg : args) { - mStack.addFireworkMeta(user, true, arg, ess); + try + { + mStack.addFireworkMeta(user, true, arg, ess); + } + catch (Exception e) + { + user.sendMessage(_("fireworkSyntax")); + throw e; + } } if (mStack.isValidFirework())