java.lang.Object
com.moyskleytech.obsidian.material.ObsidianMaterial
com.moyskleytech.obsidian.material.implementations.PotionMaterial
All Implemented Interfaces:
Comparable<ObsidianMaterial>

public class PotionMaterial extends ObsidianMaterial
Special implementation of material that defines potion
  • Constructor Details

    • PotionMaterial

      public PotionMaterial(org.bukkit.potion.PotionType effects, String key, boolean extended, boolean tier2, boolean splash)
      Build a potion material
      Parameters:
      effects - The potion type
      key - The key that uniquely define this material
      extended - If the potion has extended duration
      tier2 - If the potion is tier 2
      splash - If it's a splash potion
  • Method Details

    • isSupported

      public static boolean isSupported()
      Validate that the enchant meta data exists on the version of bukkit used
      Returns:
      If Potion materials can be used
    • toMaterial

      public org.bukkit.Material toMaterial()
      Description copied from class: ObsidianMaterial
      Obtain the bukkit material associated with this material
      Specified by:
      toMaterial in class ObsidianMaterial
      Returns:
      the enum value associated
    • toItem

      public org.bukkit.inventory.ItemStack toItem()
      Description copied from class: ObsidianMaterial
      Object a ItemStack of the desired material
      Specified by:
      toItem in class ObsidianMaterial
      Returns:
      new ItemStack
    • getMaterial

      public static ObsidianMaterial getMaterial(org.bukkit.inventory.ItemStack itemStack)
      Obtain the correct Material for a Potion
      Parameters:
      itemStack - The potion item stack
      Returns:
      Associated material