Enum Class TrophyType
- All Implemented Interfaces:
Serializable
,Comparable<TrophyType>
,Constable
An enum defining each supported trophy type, with all necessary information to create it.
Note: generally each enum entry should correspond to a Material type of a block that can be broken.
- Author:
- crash
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStack
Creates a new itemstack of this trophy typeorg.bukkit.inventory.ItemStack
createDrop
(boolean addenchants, boolean addeffects, boolean addlore) Creates a new itemstack of this trophy typestatic TrophyType
get
(org.bukkit.Material mat) Get the trophytype corresponding to a provided block materialorg.bukkit.Material
Get the material of the block that would drop this trophyGet the human-readable name of the block that drops this trophyget the config entry key that corresponds to the droprate for this trophygetLore()
get a shortened name name (lowercase, without underscores) of this enum value.static TrophyType
identifyTrophyItem
(org.bukkit.inventory.ItemStack stack) static TrophyType
identifyTrophyLore
(String loreLine) static org.bukkit.Material
resolveOreVariant
(org.bukkit.Material mat) static TrophyType
Returns the enum constant of this class with the specified name.static TrophyType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
IRON_ORE
-
GOLD_ORE
-
COPPER_ORE
-
AMETHYST_CLUSTER
-
DIAMOND_ORE
-
EMERALD_ORE
-
REDSTONE_ORE
-
LAPIS_ORE
-
NETHER_QUARTZ_ORE
-
COAL_ORE
-
SPAWNER
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getDropName
-
getBlockMaterial
public org.bukkit.Material getBlockMaterial()Get the material of the block that would drop this trophy- Returns:
- the block material
-
getBlockName
Get the human-readable name of the block that drops this trophy- Returns:
- the block name
-
getShortName
get a shortened name name (lowercase, without underscores) of this enum value.- Returns:
- the shortened name
-
getDropConfigName
get the config entry key that corresponds to the droprate for this trophy- Returns:
- the config key name
-
resolveOreVariant
public static org.bukkit.Material resolveOreVariant(org.bukkit.Material mat) -
get
Get the trophytype corresponding to a provided block material- Parameters:
mat
- the material of a block to drop a trophy when mined- Returns:
- The type of trophy for that block material, or null if none was found.
-
createDrop
public org.bukkit.inventory.ItemStack createDrop()Creates a new itemstack of this trophy type- Returns:
- the itemstack
-
getIdentifyingLore
-
identifyTrophyLore
-
identifyTrophyItem
-
getLore
-
createDrop
public org.bukkit.inventory.ItemStack createDrop(boolean addenchants, boolean addeffects, boolean addlore) Creates a new itemstack of this trophy type- Parameters:
addenchants
- controls whether to add default enchantments to the trophy itemaddeffects
- controls whether to add default potion effects to the trophy itemaddlore
- controls whether to add lore-text to the trophy item- Returns:
- the itemstack
-