diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-01-21 13:39:52 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-01-21 13:40:45 +0000 |
commit | 9cef107bc348b75bf363bb90a4cbdbef54ca0e02 (patch) | |
tree | c1f35f786be8ad5cc1b475c3d214d4413e99034a | |
parent | 76fd829e8c3498204a8b6b5effd8f6e1a6767c03 (diff) | |
download | Essentials-9cef107bc348b75bf363bb90a4cbdbef54ca0e02.tar Essentials-9cef107bc348b75bf363bb90a4cbdbef54ca0e02.tar.gz Essentials-9cef107bc348b75bf363bb90a4cbdbef54ca0e02.tar.lz Essentials-9cef107bc348b75bf363bb90a4cbdbef54ca0e02.tar.xz Essentials-9cef107bc348b75bf363bb90a4cbdbef54ca0e02.zip |
Fix a couple of param issues.
3 files changed, 12 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/MetaItemStack.java b/Essentials/src/com/earth2me/essentials/MetaItemStack.java index aabc2db1b..5eadc3935 100644 --- a/Essentials/src/com/earth2me/essentials/MetaItemStack.java +++ b/Essentials/src/com/earth2me/essentials/MetaItemStack.java @@ -175,6 +175,11 @@ public class MetaItemStack FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta(); final String[] split = splitPattern.split(string, 2); + if (split.length < 2) + { + return; + } + if (split[0].equalsIgnoreCase("color") || split[0].equalsIgnoreCase("colour") || (allowShortName && split[0].equalsIgnoreCase("c"))) { List<Color> primaryColors = new ArrayList<Color>(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbook.java b/Essentials/src/com/earth2me/essentials/commands/Commandbook.java index 79fd5fefe..1bfca2e1d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbook.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbook.java @@ -69,7 +69,10 @@ public class Commandbook extends EssentialsCommand else if (item.getType() == Material.BOOK_AND_QUILL) { BookMeta bmeta = (BookMeta)item.getItemMeta(); - bmeta.setAuthor(player); + if (!user.isAuthorized("essentals.book.author")) + { + bmeta.setAuthor(player); + } ItemStack newItem = new ItemStack(Material.WRITTEN_BOOK, item.getAmount()); newItem.setItemMeta(bmeta); user.setItemInHand(newItem); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java b/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java index 567836420..c1f553fae 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java @@ -45,7 +45,7 @@ public class Commandfirework extends EssentialsCommand { if (args.length > 0) { - final ItemStack stack = user.getItemInHand(); + final ItemStack stack = user.getItemInHand(); if (stack.getType() == Material.FIREWORK) { if (args.length > 0) @@ -65,7 +65,8 @@ public class Commandfirework extends EssentialsCommand { final String[] split = splitPattern.split(arg, 2); mStack.addFireworkMeta(user, true, arg, ess); - if (split[0].equalsIgnoreCase("fire") && user.isAuthorized("essentials.firework.fire")) + + if (split.length > 1 && split[0].equalsIgnoreCase("fire") && user.isAuthorized("essentials.firework.fire")) { fire = true; try |