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

public class HeadMaterial extends ObsidianMaterial
Special implementation allowing heads to be stored as material
  • Constructor Details

    • HeadMaterial

      public HeadMaterial(String key, String owner)
      Build a Head material for a specified owner
      Parameters:
      key - The unique key
      owner - The owner of the head
    • HeadMaterial

      public HeadMaterial(String key, org.bukkit.OfflinePlayer owner)
      Build a Head material for a specified owner
      Parameters:
      key - The unique key
      owner - The owner of the head
  • Method Details

    • with

      public HeadMaterial with(org.bukkit.OfflinePlayer p)
    • with

      public HeadMaterial with(String p)
    • getOwner

      public String getOwner()
    • getPlayer

      public org.bukkit.OfflinePlayer getPlayer()
    • isSupported

      public static boolean isSupported()
      Validate that the enchant meta data exists on the version of bukkit used
      Returns:
      If Head 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)
      return the correct ObsidianMaterial for a itemstack of a head
      Parameters:
      itemStack - The item stack to serialize
      Returns:
      The correct instance of ObsidianMaterial for the item stack