Class ObsidianItemTemplate

java.lang.Object
com.moyskleytech.obsidian.material.ObsidianItemTemplate

public class ObsidianItemTemplate extends Object
Represents a item template
  • Constructor Details

    • ObsidianItemTemplate

      public ObsidianItemTemplate()
      Create a base template containing STONE material
    • ObsidianItemTemplate

      public ObsidianItemTemplate(String parse)
      Create a material from a legacy string
      Parameters:
      parse - Legacy String
    • ObsidianItemTemplate

      public ObsidianItemTemplate(ObsidianMaterial mat)
      Create a template from a material
      Parameters:
      mat - The material of the object
    • ObsidianItemTemplate

      public ObsidianItemTemplate(org.bukkit.inventory.ItemStack mat)
      Clone a ItemStack into a template
      Parameters:
      mat - The item stack to copy
    • ObsidianItemTemplate

      public ObsidianItemTemplate(ObsidianItemTemplate template)
      Copy constructor
      Parameters:
      template - the template to make a copy of
  • Method Details

    • withHeadOwner

      public ObsidianItemTemplate withHeadOwner(org.bukkit.OfflinePlayer player)
    • withHeadOwner

      public ObsidianItemTemplate withHeadOwner(String player)
    • lore

      public ObsidianItemTemplate lore(Collection<String> lore)
      Modify the lore
      Parameters:
      lore - The lines of lore
      Returns:
      Returns a copy of the template with the modified value
    • enchants

      public ObsidianItemTemplate enchants(Map<org.bukkit.enchantments.Enchantment,Integer> enchants)
      Modify the enchants
      Parameters:
      enchants - The required enchants
      Returns:
      Returns a copy of the template with the modified value
    • durability

      public ObsidianItemTemplate durability(short mat)
      Modify the material of the template
      Parameters:
      mat - New material
      Returns:
      Returns a copy of the template with the modified value
    • material

      public ObsidianItemTemplate material(ObsidianMaterial mat)
      Modify the material of the template
      Parameters:
      mat - New material
      Returns:
      Returns a copy of the template with the modified value
    • name

      public ObsidianItemTemplate name(String name)
      Modify the display name
      Parameters:
      name - New display name or null to disable it
      Returns:
      Returns a copy of the template with the modified value
    • unbreakable

      public ObsidianItemTemplate unbreakable(boolean unbreakable)
      Modify the unbreakable state
      Parameters:
      unbreakable - new Unbreakable value
      Returns:
      Returns a copy of the template with the modified value
    • meta

      public ObsidianItemTemplate meta(org.bukkit.inventory.meta.ItemMeta meta)
      Use this for advanced object that cannot be represented only with lore and enchants
      Parameters:
      meta - New meta information associated with the object
      Returns:
      Returns a copy of the template with the modified value
    • getEnchants

      public Map<org.bukkit.enchantments.Enchantment,Integer> getEnchants()
      Get the enchants associated with the template
      Returns:
      The full list of enchants
    • getLore

      public List<String> getLore()
      Get the lines of lore for the item template
      Returns:
      The lines in the lore
    • isPure

      public boolean isPure()
      Return if the item template can be represented by the material only
      Returns:
      Return if the item template can be represented by the material only
    • isSimilar

      public boolean isSimilar(org.bukkit.inventory.ItemStack item)
      Compare the item template with a item stack for similarity
      Parameters:
      item - The item to compared againsts
      Returns:
      If the item is similar
    • toMaterial

      public org.bukkit.Material toMaterial()
      Get the material associated with the template
      Returns:
      The bukkit material of the object
    • build

      public org.bukkit.inventory.ItemStack build()
      Build the material into a itemstack
      Returns:
      A item stack
    • toItem

      public org.bukkit.inventory.ItemStack toItem()
      Build the material into a itemstack
      Returns:
      A item stack
    • isSimilar

      public boolean isSimilar(ObsidianItemTemplate oit2)
      Compare 2 item template for similarity
      Parameters:
      oit2 - The other item template
      Returns:
      If they are similar
    • toString

      public String toString()
      Overrides:
      toString in class Object