Commits
md_5 authored 98e11881045
136 136 | * Applies the effects of this potion to the given {@link ItemStack}. The |
137 137 | * ItemStack must be a potion. |
138 138 | * |
139 139 | * @param to The itemstack to apply to |
140 140 | */ |
141 141 | public void apply(ItemStack to) { |
142 142 | Validate.notNull(to, "itemstack cannot be null"); |
143 143 | Validate.isTrue(to.hasItemMeta(), "given itemstack is not a potion"); |
144 144 | Validate.isTrue(to.getItemMeta() instanceof PotionMeta, "given itemstack is not a potion"); |
145 145 | PotionMeta meta = (PotionMeta) to.getItemMeta(); |
146 - | meta.setBasePotionData(new PotionData(type, level == 2, extended)); |
146 + | meta.setBasePotionData(new PotionData(type, extended, level == 2)); |
147 147 | to.setItemMeta(meta); |
148 148 | } |
149 149 | |
150 150 | /** |
151 151 | * Applies the effects that would be applied by this potion to the given |
152 152 | * {@link LivingEntity}. |
153 153 | * |
154 154 | * @see LivingEntity#addPotionEffects(Collection) |
155 155 | * @param to The entity to apply the effects to |
156 156 | */ |