Don't set potion meta data

It causes incompatibilities with other plugins.

Fixes #1849
This commit is contained in:
TfT_02 2014-02-12 11:54:21 +01:00
parent 4b9d472f10
commit 15743c5f46

View File

@ -6,7 +6,7 @@ import java.util.Map.Entry;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.potion.PotionEffect;
public class AlchemyPotion {
@ -30,16 +30,13 @@ public class AlchemyPotion {
public ItemStack toItemStack(int amount) {
ItemStack potion = new ItemStack(Material.POTION, amount, this.getDataValue());
PotionMeta meta = (PotionMeta) potion.getItemMeta();
ItemMeta meta = potion.getItemMeta();
meta.setDisplayName(this.getName());
if (this.getLore() != null && !this.getLore().isEmpty()) {
meta.setLore(this.getLore());
}
if (!this.getEffects().isEmpty()) {
for (PotionEffect effect : this.getEffects()) {
meta.addCustomEffect(effect, true);
}
}
potion.setItemMeta(meta);
return potion;
}