summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-03-18 16:20:45 -0700
committerKHobbits <rob@khobbits.co.uk>2013-03-18 16:20:45 -0700
commit2e5d09b04a8c994351de41f8d577dc263129523e (patch)
treecc1dd05724020fcc48c0f7b1c942d08f83d8b755
parentfa99942375dc398d0c4cb4dc0d567cb39677f6e1 (diff)
parenta3df17dbbb9c55d04befbcf3a98767fba7cdbb10 (diff)
downloadEssentials-2e5d09b04a8c994351de41f8d577dc263129523e.tar
Essentials-2e5d09b04a8c994351de41f8d577dc263129523e.tar.gz
Essentials-2e5d09b04a8c994351de41f8d577dc263129523e.tar.lz
Essentials-2e5d09b04a8c994351de41f8d577dc263129523e.tar.xz
Essentials-2e5d09b04a8c994351de41f8d577dc263129523e.zip
Merge pull request #396 from GunfighterJ/2.9
Allow potion clear/apply commands to work
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandpotion.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpotion.java b/Essentials/src/com/earth2me/essentials/commands/Commandpotion.java
index 257509d4f..1e0937e6f 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandpotion.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandpotion.java
@@ -42,11 +42,6 @@ public class Commandpotion extends EssentialsCommand
}
throw new NotEnoughArgumentsException(_("potions", Util.joinList(potionslist.toArray())));
}
-
- if (args.length < 3)
- {
- throw new NotEnoughArgumentsException();
- }
if (stack.getType() == Material.POTION)
{
@@ -60,11 +55,15 @@ public class Commandpotion extends EssentialsCommand
}
else if (args[0].equalsIgnoreCase("apply") && user.isAuthorized("essentials.potion.apply"))
{
- for(PotionEffect effect : pmeta.getCustomEffects())
+ for (PotionEffect effect : pmeta.getCustomEffects())
{
effect.apply(user);
}
}
+ else if (args.length < 3)
+ {
+ throw new NotEnoughArgumentsException();
+ }
else
{
final MetaItemStack mStack = new MetaItemStack(stack);