Class GlowMetaPotion

java.lang.Object
net.glowstone.inventory.GlowMetaItem
net.glowstone.inventory.GlowMetaPotion
All Implemented Interfaces:
Cloneable, org.bukkit.configuration.serialization.ConfigurationSerializable, org.bukkit.inventory.meta.ItemMeta, org.bukkit.inventory.meta.PotionMeta, org.bukkit.persistence.PersistentDataHolder

public class GlowMetaPotion extends GlowMetaItem implements org.bukkit.inventory.meta.PotionMeta
  • Constructor Details

    • GlowMetaPotion

      public GlowMetaPotion(org.bukkit.inventory.meta.ItemMeta meta)
      Creates an instance by copying from the given ItemMeta. If that item is another PotionMeta, its color, PotionData and PotionEffects are copied; otherwise, the new potion has no effects.
      Parameters:
      meta - the ItemMeta to copy
  • Method Details

    • copyFrom

      public void copyFrom(org.bukkit.inventory.meta.PotionMeta source)
      Copies potion data from another instance
      Parameters:
      source - The object to copy from
    • fromNbt

      public static org.bukkit.potion.PotionEffect fromNbt(CompoundTag tag)
      Reads a PotionEffect from an NBT compound tag.
      Parameters:
      tag - a potion effect NBT compound tag
      Returns:
      tag as a PotionEffect
    • toNbt

      public static CompoundTag toNbt(org.bukkit.potion.PotionEffect effect)
      Converts a PotionEffect to an NBT compound tag.
      Parameters:
      effect - the potion effect
      Returns:
      effect as an NBT compound tag
    • isApplicable

      public boolean isApplicable(org.bukkit.Material material)
      Description copied from class: GlowMetaItem
      Check whether this ItemMeta can be applied to the given material.
      Overrides:
      isApplicable in class GlowMetaItem
      Parameters:
      material - The Material.
      Returns:
      True if this ItemMeta is applicable.
    • clone

      @NotNull public @NotNull GlowMetaPotion clone()
      Specified by:
      clone in interface org.bukkit.inventory.meta.ItemMeta
      Specified by:
      clone in interface org.bukkit.inventory.meta.PotionMeta
      Overrides:
      clone in class GlowMetaItem
    • serialize

      @NotNull public @NotNull Map<String,Object> serialize()
      Specified by:
      serialize in interface org.bukkit.configuration.serialization.ConfigurationSerializable
      Overrides:
      serialize in class GlowMetaItem
    • hasCustomEffects

      public boolean hasCustomEffects()
      Specified by:
      hasCustomEffects in interface org.bukkit.inventory.meta.PotionMeta
    • getCustomEffects

      @NotNull public @NotNull List<org.bukkit.potion.PotionEffect> getCustomEffects()
      Specified by:
      getCustomEffects in interface org.bukkit.inventory.meta.PotionMeta
    • addCustomEffect

      public boolean addCustomEffect(@NotNull @NotNull org.bukkit.potion.PotionEffect effect, boolean overwrite)
      Specified by:
      addCustomEffect in interface org.bukkit.inventory.meta.PotionMeta
    • removeCustomEffect

      public boolean removeCustomEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type)
      Specified by:
      removeCustomEffect in interface org.bukkit.inventory.meta.PotionMeta
    • hasCustomEffect

      public boolean hasCustomEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type)
      Specified by:
      hasCustomEffect in interface org.bukkit.inventory.meta.PotionMeta
    • setMainEffect

      public boolean setMainEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type)
      Specified by:
      setMainEffect in interface org.bukkit.inventory.meta.PotionMeta
    • clearCustomEffects

      public boolean clearCustomEffects()
      Specified by:
      clearCustomEffects in interface org.bukkit.inventory.meta.PotionMeta
    • hasColor

      public boolean hasColor()
      Specified by:
      hasColor in interface org.bukkit.inventory.meta.PotionMeta
    • dataToString

      public static String dataToString(org.bukkit.potion.PotionData basePotionData)
      Converts a PotionData to a Potion ID string.
      Parameters:
      basePotionData - the PotionData to convert
      Returns:
      the Potion ID string
    • getBasePotionData

      public org.bukkit.potion.PotionData getBasePotionData()
      Specified by:
      getBasePotionData in interface org.bukkit.inventory.meta.PotionMeta
    • setBasePotionData

      public void setBasePotionData(org.bukkit.potion.PotionData basePotionData)
      Specified by:
      setBasePotionData in interface org.bukkit.inventory.meta.PotionMeta
    • getColor

      public org.bukkit.Color getColor()
      Specified by:
      getColor in interface org.bukkit.inventory.meta.PotionMeta
    • setColor

      public void setColor(org.bukkit.Color color)
      Specified by:
      setColor in interface org.bukkit.inventory.meta.PotionMeta