mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Don't set potion meta data
It causes incompatibilities with other plugins. Fixes #1849
This commit is contained in:
parent
4b9d472f10
commit
15743c5f46
@ -6,7 +6,7 @@ import java.util.Map.Entry;
|
|||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.PotionMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
|
||||||
public class AlchemyPotion {
|
public class AlchemyPotion {
|
||||||
@ -30,16 +30,13 @@ public class AlchemyPotion {
|
|||||||
|
|
||||||
public ItemStack toItemStack(int amount) {
|
public ItemStack toItemStack(int amount) {
|
||||||
ItemStack potion = new ItemStack(Material.POTION, amount, this.getDataValue());
|
ItemStack potion = new ItemStack(Material.POTION, amount, this.getDataValue());
|
||||||
PotionMeta meta = (PotionMeta) potion.getItemMeta();
|
|
||||||
|
ItemMeta meta = potion.getItemMeta();
|
||||||
meta.setDisplayName(this.getName());
|
meta.setDisplayName(this.getName());
|
||||||
if (this.getLore() != null && !this.getLore().isEmpty()) {
|
if (this.getLore() != null && !this.getLore().isEmpty()) {
|
||||||
meta.setLore(this.getLore());
|
meta.setLore(this.getLore());
|
||||||
}
|
}
|
||||||
if (!this.getEffects().isEmpty()) {
|
|
||||||
for (PotionEffect effect : this.getEffects()) {
|
|
||||||
meta.addCustomEffect(effect, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
potion.setItemMeta(meta);
|
potion.setItemMeta(meta);
|
||||||
return potion;
|
return potion;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user