SPIGOT-1638 / SPIGOT-1673: Rework Potions API

By: t00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2016-03-02 20:43:58 -05:00
parent d490a6e384
commit 104519f08f
20 changed files with 622 additions and 121 deletions

View File

@@ -30,6 +30,8 @@ import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.inventory.meta.MapMeta;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionType;
import org.bukkit.support.AbstractTestingBase;
import org.junit.Test;
@@ -177,6 +179,7 @@ public class ItemMetaTest extends AbstractTestingBase {
new StackProvider(Material.POTION) {
@Override ItemStack operate(final ItemStack cleanStack) {
final PotionMeta meta = (PotionMeta) cleanStack.getItemMeta();
meta.setBasePotionData(new PotionData(PotionType.UNCRAFTABLE, false, false));
meta.addCustomEffect(PotionEffectType.CONFUSION.createEffect(1, 1), false);
cleanStack.setItemMeta(meta);
return cleanStack;