Enum Class ItemTrait

java.lang.Object
java.lang.Enum<ItemTrait>
redempt.redlib.itemutils.ItemTrait
All Implemented Interfaces:
Serializable, Comparable<ItemTrait>, Constable

public enum ItemTrait extends Enum<ItemTrait>
A set of comparable traits items have and can be compared with ItemUtils.compare(ItemStack, ItemStack, ItemTrait...)
  • Enum Constant Details

    • DURABILITY

      public static final ItemTrait DURABILITY
      For comparing the durability of two items
    • AMOUNT

      public static final ItemTrait AMOUNT
      For comparing the amount of two items
    • NAME

      public static final ItemTrait NAME
      For comparing the display name of two items
    • LORE

      public static final ItemTrait LORE
      For comparing the lore of two items
    • ENCHANTMENTS

      public static final ItemTrait ENCHANTMENTS
      For comparing the enchantments of two items
    • TYPE

      public static final ItemTrait TYPE
      For comparing the types of two items
  • Method Details

    • values

      public static ItemTrait[] 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

      public static ItemTrait valueOf(String name)
      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 name
      NullPointerException - 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 item
      b - The second item
      Returns:
      True if the trait is the same on both items, false otherwise