1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-14 18:44:48 +02:00

Merge pull request #396 from GunfighterJ/2.9

Allow potion clear/apply commands to work
This commit is contained in:
KHobbits
2013-03-18 16:20:45 -07:00

View File

@@ -43,11 +43,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)
{
PotionMeta pmeta = (PotionMeta)stack.getItemMeta();
@@ -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);