Package redempt.redlib.itemutils
Enum Class ItemTrait
- All Implemented Interfaces:
Serializable
,Comparable<ItemTrait>
,Constable
A set of comparable traits items have and can be compared with
ItemUtils.compare(ItemStack, ItemStack, ItemTrait...)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionFor comparing the amount of two itemsFor comparing the durability of two itemsFor comparing the enchantments of two itemsFor comparing the lore of two itemsFor comparing the display name of two itemsFor comparing the types of two items -
Method Summary
Modifier and TypeMethodDescriptionboolean
compare
(org.bukkit.inventory.ItemStack a, org.bukkit.inventory.ItemStack b) Compares this trait on the two itemsstatic ItemTrait
Returns the enum constant of this class with the specified name.static ItemTrait[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DURABILITY
For comparing the durability of two items -
AMOUNT
For comparing the amount of two items -
NAME
For comparing the display name of two items -
LORE
For comparing the lore of two items -
ENCHANTMENTS
For comparing the enchantments of two items -
TYPE
For comparing the types of two items
-
-
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
-
compare
public boolean compare(org.bukkit.inventory.ItemStack a, org.bukkit.inventory.ItemStack b) Compares this trait on the two items- Parameters:
a
- The first itemb
- The second item- Returns:
- True if the trait is the same on both items, false otherwise
-