summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-01-21 13:39:52 +0000
committerKHobbits <rob@khobbits.co.uk>2013-01-21 13:40:45 +0000
commit150732e520c2c1ba512dd559901735fefba4b037 (patch)
treee34ddd8a66483229730f40b80f97f0bb29ab387d
parent42901f6d609acb7c7f2ca7c99efa3d35eb44ef36 (diff)
downloadEssentials-150732e520c2c1ba512dd559901735fefba4b037.tar
Essentials-150732e520c2c1ba512dd559901735fefba4b037.tar.gz
Essentials-150732e520c2c1ba512dd559901735fefba4b037.tar.lz
Essentials-150732e520c2c1ba512dd559901735fefba4b037.tar.xz
Essentials-150732e520c2c1ba512dd559901735fefba4b037.zip
Fix a couple of param issues.
-rw-r--r--Essentials/src/com/earth2me/essentials/MetaItemStack.java5
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbook.java5
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandfirework.java5
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