diff --git a/Essentials/src/com/earth2me/essentials/MetaItemStack.java b/Essentials/src/com/earth2me/essentials/MetaItemStack.java index f0f908ad5..e6ac632d4 100644 --- a/Essentials/src/com/earth2me/essentials/MetaItemStack.java +++ b/Essentials/src/com/earth2me/essentials/MetaItemStack.java @@ -12,6 +12,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.*; +import org.bukkit.potion.*; public class MetaItemStack @@ -21,7 +22,16 @@ public class MetaItemStack private final static Map colorMap = new HashMap(); private final static Map fireworkShape = new HashMap(); private FireworkEffect.Builder builder = FireworkEffect.builder(); + private PotionEffectType pEffectType; + private PotionEffect pEffect; private boolean validFirework = false; + private boolean validPotionEffect = false; + private boolean validPotionDuration = false; + private boolean validPotionPower = false; + private boolean canceledEffect = false; + private boolean completePotion = false; + private int power = 1; + private int duration = 120; static { @@ -50,11 +60,36 @@ public class MetaItemStack return validFirework; } + public boolean isValidPotion() + { + return validPotionEffect && validPotionDuration && validPotionPower; + } + public FireworkEffect.Builder getFireworkBuilder() { return builder; } + public PotionEffect getPotionEffect() + { + return pEffect; + } + + public boolean completePotion() + { + return completePotion; + } + + private void resetPotionMeta() + { + pEffect = null; + pEffectType = null; + validPotionEffect = false; + validPotionDuration = false; + validPotionPower = false; + completePotion = true; + } + public void parseStringMeta(final CommandSender user, final boolean allowUnsafe, String[] string, int fromArg, final IEssentials ess) throws Exception { @@ -148,6 +183,10 @@ public class MetaItemStack { addFireworkMeta(user, false, string, ess); } + else if (stack.getType() == Material.POTION) //WARNING - Meta for potions will be ignored after this point. + { + addPotionMeta(user, false, string, ess); + } else if (split.length > 1 && (split[0].equalsIgnoreCase("color") || split[0].equalsIgnoreCase("colour")) && (stack.getType() == Material.LEATHER_BOOTS || stack.getType() == Material.LEATHER_CHESTPLATE @@ -210,7 +249,6 @@ public class MetaItemStack { user.sendMessage(_("fireworkSyntax")); throw new Exception(_("invalidFireworkFormat", split[1], split[0])); - } } builder.withColor(primaryColors); @@ -277,6 +315,70 @@ public class MetaItemStack } } + public void addPotionMeta(final CommandSender user, final boolean allowShortName, final String string, final IEssentials ess) throws Exception + { + if (stack.getType() == Material.POTION) + { + final User player = ess.getUser(user); + final String[] split = splitPattern.split(string, 2); + + if (split.length < 2) + { + return; + } + + if (split[0].equalsIgnoreCase("effect")) + { + pEffectType = Potions.getByName(split[1]); + if (pEffectType != null) + { + if(player != null && player.isAuthorized("essentials.potion." + pEffectType.getName().toLowerCase())) + { + validPotionEffect = true; + canceledEffect = false; + } + else + { + canceledEffect = true; + user.sendMessage(_("invalidPotionEffect", pEffectType.getName().toLowerCase())); + } + } + else + { + user.sendMessage("Invalid potion effect"); + canceledEffect = true; + } + } + else if (split[0].equalsIgnoreCase("power")) + { + if (Util.isInt(split[1])) + { + validPotionPower = true; + power = Integer.parseInt(split[1]); + } + } + else if (split[0].equalsIgnoreCase("duration") || split[0].equalsIgnoreCase("dur")) + { + if (Util.isInt(split[1])) + { + validPotionDuration = true; + duration = Integer.parseInt(split[1]) * 20; //Duration is in ticks by default, converted to seconds + } + } + + if (isValidPotion() && !canceledEffect) + { + PotionMeta pmeta = (PotionMeta)stack.getItemMeta(); + pEffect = pEffectType.createEffect(duration, power); + pmeta.addCustomEffect(pEffect, true); + stack.setItemMeta(pmeta); + resetPotionMeta(); + } + + + } + } + private void parseEnchantmentStrings(final CommandSender user, final boolean allowUnsafe, final String[] split) throws Exception { Enchantment enchantment = getEnchantment(null, split[0]); diff --git a/Essentials/src/com/earth2me/essentials/Potions.java b/Essentials/src/com/earth2me/essentials/Potions.java new file mode 100644 index 000000000..7d3858183 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/Potions.java @@ -0,0 +1,129 @@ +package com.earth2me.essentials; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import org.bukkit.potion.PotionEffectType; + + +public class Potions +{ + private static final Map POTIONS = new HashMap(); + private static final Map ALIASPOTIONS = new HashMap(); + + static + { + + POTIONS.put("speed", PotionEffectType.SPEED); + ALIASPOTIONS.put("fast", PotionEffectType.SPEED); + ALIASPOTIONS.put("runfast", PotionEffectType.SPEED); + ALIASPOTIONS.put("sprint", PotionEffectType.SPEED); + ALIASPOTIONS.put("swift", PotionEffectType.SPEED); + + POTIONS.put("slowness", PotionEffectType.SLOW); + ALIASPOTIONS.put("slow", PotionEffectType.SLOW); + ALIASPOTIONS.put("sluggish", PotionEffectType.SLOW); + + POTIONS.put("haste", PotionEffectType.FAST_DIGGING); + ALIASPOTIONS.put("superpick", PotionEffectType.FAST_DIGGING); + ALIASPOTIONS.put("quickmine", PotionEffectType.FAST_DIGGING); + ALIASPOTIONS.put("digspeed", PotionEffectType.FAST_DIGGING); + ALIASPOTIONS.put("digfast", PotionEffectType.FAST_DIGGING); + ALIASPOTIONS.put("sharp", PotionEffectType.FAST_DIGGING); + + POTIONS.put("fatigue", PotionEffectType.SLOW_DIGGING); + ALIASPOTIONS.put("slow", PotionEffectType.SLOW_DIGGING); + ALIASPOTIONS.put("dull", PotionEffectType.SLOW_DIGGING); + + POTIONS.put("strength", PotionEffectType.INCREASE_DAMAGE); + ALIASPOTIONS.put("strong", PotionEffectType.INCREASE_DAMAGE); + ALIASPOTIONS.put("bull", PotionEffectType.INCREASE_DAMAGE); + ALIASPOTIONS.put("attack", PotionEffectType.INCREASE_DAMAGE); + + POTIONS.put("heal", PotionEffectType.HEAL); + ALIASPOTIONS.put("healthy", PotionEffectType.HEAL); + ALIASPOTIONS.put("instaheal", PotionEffectType.HEAL); + + POTIONS.put("harm", PotionEffectType.HARM); + ALIASPOTIONS.put("injure", PotionEffectType.HARM); + ALIASPOTIONS.put("damage", PotionEffectType.HARM); + ALIASPOTIONS.put("inflict", PotionEffectType.HARM); + + POTIONS.put("jump", PotionEffectType.JUMP); + ALIASPOTIONS.put("leap", PotionEffectType.JUMP); + + POTIONS.put("nausea", PotionEffectType.CONFUSION); + ALIASPOTIONS.put("sick", PotionEffectType.CONFUSION); + ALIASPOTIONS.put("sickness", PotionEffectType.CONFUSION); + ALIASPOTIONS.put("confusion", PotionEffectType.CONFUSION); + + POTIONS.put("regeneration", PotionEffectType.REGENERATION); + ALIASPOTIONS.put("regen", PotionEffectType.REGENERATION); + + POTIONS.put("resistance", PotionEffectType.DAMAGE_RESISTANCE); + ALIASPOTIONS.put("dmgresist", PotionEffectType.DAMAGE_RESISTANCE); + ALIASPOTIONS.put("armor", PotionEffectType.DAMAGE_RESISTANCE); + ALIASPOTIONS.put("dmgresist", PotionEffectType.DAMAGE_RESISTANCE); + + POTIONS.put("fireresist", PotionEffectType.FIRE_RESISTANCE); + ALIASPOTIONS.put("fireresistance", PotionEffectType.FIRE_RESISTANCE); + ALIASPOTIONS.put("resistfire", PotionEffectType.FIRE_RESISTANCE); + + POTIONS.put("waterbreath", PotionEffectType.WATER_BREATHING); + ALIASPOTIONS.put("waterbreathing", PotionEffectType.WATER_BREATHING); + + POTIONS.put("invisibility", PotionEffectType.INVISIBILITY); + ALIASPOTIONS.put("invisible", PotionEffectType.INVISIBILITY); + ALIASPOTIONS.put("invis", PotionEffectType.INVISIBILITY); + ALIASPOTIONS.put("vanish", PotionEffectType.INVISIBILITY); + ALIASPOTIONS.put("disappear", PotionEffectType.INVISIBILITY); + + POTIONS.put("blindness", PotionEffectType.BLINDNESS); + ALIASPOTIONS.put("blind", PotionEffectType.BLINDNESS); + + POTIONS.put("nightvision", PotionEffectType.NIGHT_VISION); + ALIASPOTIONS.put("vision", PotionEffectType.NIGHT_VISION); + + POTIONS.put("hunger", PotionEffectType.HUNGER); + ALIASPOTIONS.put("hungry", PotionEffectType.HUNGER); + ALIASPOTIONS.put("starve", PotionEffectType.HUNGER); + + POTIONS.put("weakness", PotionEffectType.WEAKNESS); + ALIASPOTIONS.put("weak", PotionEffectType.WEAKNESS); + + POTIONS.put("poison", PotionEffectType.POISON); + ALIASPOTIONS.put("venom", PotionEffectType.POISON); + + POTIONS.put("wither", PotionEffectType.WITHER); + ALIASPOTIONS.put("decay", PotionEffectType.WITHER); + } + + public static PotionEffectType getByName(String name) + { + PotionEffectType peffect; + if (Util.isInt(name)) + { + peffect = PotionEffectType.getById(Integer.parseInt(name)); + } + else + { + peffect = PotionEffectType.getByName(name.toUpperCase(Locale.ENGLISH)); + } + if (peffect == null) + { + peffect = POTIONS.get(name.toLowerCase(Locale.ENGLISH)); + } + if (peffect == null) + { + peffect = ALIASPOTIONS.get(name.toLowerCase(Locale.ENGLISH)); + } + return peffect; + } + + public static Set> entrySet() + { + return POTIONS.entrySet(); + } +} \ No newline at end of file diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java b/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java index f476a1846..77bbb0e1a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java @@ -4,10 +4,7 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.MetaItemStack; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; -import java.util.HashMap; -import java.util.Map; import java.util.regex.Pattern; -import org.bukkit.DyeColor; import org.bukkit.FireworkEffect; import org.bukkit.Material; import org.bukkit.Server; @@ -36,20 +33,6 @@ import org.bukkit.util.Vector; public class Commandfirework extends EssentialsCommand { private final transient Pattern splitPattern = Pattern.compile("[:+',;.]"); - private final static Map colorMap = new HashMap(); - private final static Map fireworkShape = new HashMap(); - - static - { - for (DyeColor color : DyeColor.values()) - { - colorMap.put(color.name(), color); - } - for (FireworkEffect.Type type : FireworkEffect.Type.values()) - { - fireworkShape.put(type.name(), type); - } - } public Commandfirework() { @@ -125,7 +108,6 @@ public class Commandfirework extends EssentialsCommand final MetaItemStack mStack = new MetaItemStack(stack); for (String arg : args) { - final String[] split = splitPattern.split(arg, 2); mStack.addFireworkMeta(user, true, arg, ess); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpotion.java b/Essentials/src/com/earth2me/essentials/commands/Commandpotion.java new file mode 100644 index 000000000..212c5e1eb --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpotion.java @@ -0,0 +1,84 @@ +package com.earth2me.essentials.commands; + +import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.MetaItemStack; +import com.earth2me.essentials.Potions; +import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import java.util.regex.Pattern; +import org.bukkit.Material; +import org.bukkit.Server; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.potion.PotionEffectType; + + +public class Commandpotion extends EssentialsCommand +{ + private final transient Pattern splitPattern = Pattern.compile("[:+',;.]"); + + public Commandpotion() + { + super("potion"); + } + + @Override + protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception + { + final ItemStack stack = user.getItemInHand(); + + if (args.length == 0) + { + final Set potionslist = new TreeSet(); + for (Map.Entry entry : Potions.entrySet()) + { + final String potionName = entry.getValue().getName().toLowerCase(Locale.ENGLISH); + if (potionslist.contains(potionName) || (user.isAuthorized("essentials.potion." + potionName))) + { + potionslist.add(entry.getKey()); + } + } + throw new NotEnoughArgumentsException(_("potions", Util.joinList(potionslist.toArray()))); + } + + if (stack.getType() == Material.POTION) + { + if (args.length > 0) + { + if (args[0].equalsIgnoreCase("clear")) + { + PotionMeta pmeta = (PotionMeta)stack.getItemMeta(); + pmeta.clearCustomEffects(); + stack.setItemMeta(pmeta); + } + else + { + final MetaItemStack mStack = new MetaItemStack(stack); + for (String arg : args) + { + mStack.addPotionMeta(user, true, arg, ess); + } + if (mStack.completePotion()) + { + PotionMeta pmeta = (PotionMeta)mStack.getItemStack().getItemMeta(); + stack.setItemMeta(pmeta); + } + else + { + user.sendMessage("Invalid potion"); + throw new NotEnoughArgumentsException(); + } + } + } + + } + else + { + throw new Exception(_("holdPotion")); + } + } +} diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 97b5ae170..9f30ead6e 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -497,3 +497,6 @@ userAFK=\u00a75{0} \u00a75is currently AFK and may not respond fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index 136dbbcd6..3499482bc 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -500,3 +500,6 @@ userAFK=\u00a75{0} \u00a75is currently AFK and may not respond fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index c85e02edf..391e415c9 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -497,3 +497,6 @@ userAFK=\u00a75{0} \u00a75is currently AFK and may not respond fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index a664db0ba..f6af8c9d6 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -497,3 +497,6 @@ userAFK=\u00a75{0} \u00a75is currently AFK and may not respond fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 4789c0321..5e92e3877 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -497,3 +497,6 @@ userAFK=\u00a75{0} \u00a75is currently AFK and may not respond fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index e0ce7dde1..00ffc2ed0 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -497,3 +497,6 @@ userAFK=\u00a75{0} \u00a75is currently AFK and may not respond fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/messages_fi.properties b/Essentials/src/messages_fi.properties index 09b008bf5..14f6a76af 100644 --- a/Essentials/src/messages_fi.properties +++ b/Essentials/src/messages_fi.properties @@ -497,3 +497,6 @@ userAFK=\u00a75{0} \u00a75is currently AFK and may not respond fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 2b9de10c7..b18b2a688 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -497,3 +497,6 @@ userAFK=\u00a75{0} \u00a75is currently AFK and may not respond fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties index 94cd6c0b8..d9fd3f723 100644 --- a/Essentials/src/messages_it.properties +++ b/Essentials/src/messages_it.properties @@ -497,3 +497,6 @@ userAFK=\u00a75{0} \u00a75is currently AFK and may not respond fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index f03225e8c..c8ff0493b 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -497,3 +497,6 @@ userAFK=\u00a75{0} \u00a75is currently AFK and may not respond fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index ffcdb8fd3..743bbb90a 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -497,3 +497,6 @@ userAFK=\u00a75{0} \u00a75is currently AFK and may not respond fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index 2caf8dcde..4fae721ef 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -497,3 +497,6 @@ userAFK=\u00a75{0} \u00a75is currently AFK and may not respond fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/messages_se.properties b/Essentials/src/messages_se.properties index 393342966..240db04b2 100644 --- a/Essentials/src/messages_se.properties +++ b/Essentials/src/messages_se.properties @@ -497,3 +497,6 @@ userAFK=\u00a75{0} \u00a75\u00c3\u00a4r f\u00c3\u00b6r n\u00c3\u00a4rvarande bor fireworkEffectsCleared=\u00a76Removed all effects from held stack. fireworkSyntax=\u00a76Firework parameters:\u00a7c color: [fade:] [shape:] [effect:]\n\u00a76To use multiple colors/effects, seperate values with commas: \u00a7cred,blue,pink\n\u00a76Shapes:\u00a7c star, ball, large, creeper, burst \u00a76Effects:\u00a7c trail, twinkle bed=\u00a7obed\u00a7r +invalidPotionEffect=\u00a74You do not have permissions to apply potion effect \u00a7c{0} \u00a74to this potion +potions=\u00a76Potions:\u00a7r {0} +holdPotion=\u00a74You must be holding a potion to apply effects to it diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 054bcbdda..216103e1b 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -266,6 +266,10 @@ commands: description: Pong! usage: / aliases: [pong,echo,echo,eping,epong] + potion: + description: Adds custom potion effects to a potion. + usage: / effect: power: duration: + aliases: [epotion,elixer,eelixer] powertool: description: Assigns a command to the item in hand. usage: / [l:|a:|r:|c:|d:][command] [arguments] - {player} can be replaced by name of a clicked player.