Class TreasureKey
java.lang.Object
com.Moshu.TreasureHunt.Components.TreasureKey
Represents a treasure key that can be used to unlock treasures.
 This class manages the configuration and validation of treasure keys,
 supporting various item types including vanilla items, custom items from
 ItemsAdder, Oraxen, Nexo, and MMOItems.
- 
Constructor Summary
ConstructorsConstructorDescriptionTreasureKey(boolean enabled, String itemStr, String name, List<String> lore) Creates a new treasure key with the specified configuration. - 
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.MaterialgetItem()org.bukkit.inventory.ItemStackgetItemStack(int amount) getLore()getName()static booleanisKey(org.bukkit.inventory.ItemStack apparentKey) booleanChecks if this key is an MMOItems item.booleanisTreasureKey(org.bukkit.inventory.ItemStack apparentKey) booleanChecks if a key is required to open the treasure.voidsetEnabled(boolean enabled) voidsetItem(org.bukkit.Material item) voidsetItemString(String item) voidvoid 
- 
Constructor Details
- 
TreasureKey
Creates a new treasure key with the specified configuration.- Parameters:
 enabled- Whether the key requirement is enableditemStr- The item identifier stringname- The display name of the keylore- The lore text for the key
 
 - 
 - 
Method Details
- 
requiresKey
public boolean requiresKey()Checks if a key is required to open the treasure.- Returns:
 - True if a key is required, false otherwise
 
 - 
setEnabled
public void setEnabled(boolean enabled)  - 
getItem
public org.bukkit.Material getItem() - 
setItem
public void setItem(org.bukkit.Material item)  - 
getName
 - 
setName
 - 
getLore
 - 
setLore
 - 
getItemId
 - 
setItemString
 - 
isMMOItem
public boolean isMMOItem()Checks if this key is an MMOItems item.- Returns:
 - True if it's an MMOItems item, false otherwise
 
 - 
getItemStack
public org.bukkit.inventory.ItemStack getItemStack(int amount)  - 
isTreasureKey
public boolean isTreasureKey(org.bukkit.inventory.ItemStack apparentKey)  - 
isKey
public static boolean isKey(org.bukkit.inventory.ItemStack apparentKey)  
 -