Class ObsidianItemTemplate
java.lang.Object
com.moyskleytech.obsidian.material.ObsidianItemTemplate
Represents a item template
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a base template containing STONE materialObsidianItemTemplate(ObsidianItemTemplate template) Copy constructorCreate a template from a materialObsidianItemTemplate(String parse) Create a material from a legacy stringObsidianItemTemplate(org.bukkit.inventory.ItemStack mat) Clone a ItemStack into a template -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStackbuild()Build the material into a itemstackdurability(short mat) Modify the material of the templateModify the enchantsGet the enchants associated with the templategetLore()Get the lines of lore for the item templatebooleanisPure()Return if the item template can be represented by the material onlybooleanCompare 2 item template for similaritybooleanisSimilar(org.bukkit.inventory.ItemStack item) Compare the item template with a item stack for similaritylore(Collection<String> lore) Modify the lorematerial(ObsidianMaterial mat) Modify the material of the templatemeta(org.bukkit.inventory.meta.ItemMeta meta) Use this for advanced object that cannot be represented only with lore and enchantsModify the display nameorg.bukkit.inventory.ItemStacktoItem()Build the material into a itemstackorg.bukkit.MaterialGet the material associated with the templatetoString()unbreakable(boolean unbreakable) Modify the unbreakable statewithHeadOwner(String player) withHeadOwner(org.bukkit.OfflinePlayer player)
-
Constructor Details
-
ObsidianItemTemplate
public ObsidianItemTemplate()Create a base template containing STONE material -
ObsidianItemTemplate
Create a material from a legacy string- Parameters:
parse- Legacy String
-
ObsidianItemTemplate
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
Copy constructor- Parameters:
template- the template to make a copy of
-
-
Method Details
-
withHeadOwner
-
withHeadOwner
-
lore
Modify the lore- Parameters:
lore- The lines of lore- Returns:
- Returns a copy of the template with the modified value
-
enchants
Modify the enchants- Parameters:
enchants- The required enchants- Returns:
- Returns a copy of the template with the modified value
-
durability
Modify the material of the template- Parameters:
mat- New material- Returns:
- Returns a copy of the template with the modified value
-
material
Modify the material of the template- Parameters:
mat- New material- Returns:
- Returns a copy of the template with the modified value
-
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
Modify the unbreakable state- Parameters:
unbreakable- new Unbreakable value- Returns:
- Returns a copy of the template with the modified value
-
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
Get the enchants associated with the template- Returns:
- The full list of enchants
-
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
Compare 2 item template for similarity- Parameters:
oit2- The other item template- Returns:
- If they are similar
-
toString
-