summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-02-11 08:41:47 -0800
committerKHobbits <rob@khobbits.co.uk>2013-02-11 08:41:47 -0800
commit8ea0a152d46b8b75a86abd90a98fe3e6a54dbdf5 (patch)
tree60e2bf4609333eee6decbae2e3684f76160fb924
parent05aeba521fb18f21634aa185e213979a1bce96c6 (diff)
parent8e205768b3c45991cfb7bd4d1610fd8faea95f32 (diff)
downloadEssentials-8ea0a152d46b8b75a86abd90a98fe3e6a54dbdf5.tar
Essentials-8ea0a152d46b8b75a86abd90a98fe3e6a54dbdf5.tar.gz
Essentials-8ea0a152d46b8b75a86abd90a98fe3e6a54dbdf5.tar.lz
Essentials-8ea0a152d46b8b75a86abd90a98fe3e6a54dbdf5.tar.xz
Essentials-8ea0a152d46b8b75a86abd90a98fe3e6a54dbdf5.zip
Merge pull request #321 from GunfighterJ/patch-10
Fix array index out of bounds on /firework fire
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandfirework.java25
-rw-r--r--Essentials/src/plugin.yml2
2 files changed, 15 insertions, 12 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java b/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java
index f476a1846..182028235 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java
@@ -85,24 +85,27 @@ public class Commandfirework extends EssentialsCommand
}
stack.setItemMeta(fmeta);
}
- else if ((args[0].equalsIgnoreCase("fire") || (args[0].equalsIgnoreCase("p")))
+ else if ((args[0].equalsIgnoreCase("fire") || (args[0].equalsIgnoreCase("f")))
&& user.isAuthorized("essentials.firework.fire"))
{
int amount = 1;
boolean direction = false;
- if (Util.isInt(args[1]))
+ if (args.length > 1)
{
- final int serverLimit = ess.getSettings().getSpawnMobLimit();
- amount = Integer.parseInt(args[1]);
- if (amount > serverLimit)
+ if (Util.isInt(args[1]))
{
- amount = serverLimit;
- user.sendMessage(_("mobSpawnLimit"));
+ final int serverLimit = ess.getSettings().getSpawnMobLimit();
+ amount = Integer.parseInt(args[1]);
+ if (amount > serverLimit)
+ {
+ amount = serverLimit;
+ user.sendMessage(_("mobSpawnLimit"));
+ }
+ }
+ else
+ {
+ direction = true;
}
- }
- else
- {
- direction = true;
}
for (int i = 0; i < amount; i++)
{
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index dc48da260..f0b903f98 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -121,7 +121,7 @@ commands:
aliases: [efireball,fireskull,efireskull,fireentity,efireentity]
firework:
description: Allows you to modify a stack of fireworks
- usage: /<command> <<meta param>|power [amount]|clear|fire>
+ usage: /<command> <<meta param>|power [amount]|clear|fire [amount]>
aliases: [efirework]
gamemode:
description: Change player gamemode.