2
0
Эх сурвалжийг харах

Don't set potion meta data

It causes incompatibilities with other plugins.

Fixes #1849
TfT_02 11 жил өмнө
parent
commit
15743c5f46

+ 4 - 7
src/main/java/com/gmail/nossr50/datatypes/skills/alchemy/AlchemyPotion.java

@@ -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;
     }