Enum Class CustomItemType

java.lang.Object
java.lang.Enum<CustomItemType>
org.strassburger.lifestealz.util.customitems.CustomItemType
All Implemented Interfaces:
Serializable, Comparable<CustomItemType>, Constable

public enum CustomItemType extends Enum<CustomItemType>
Represents the type of a custom item in the LifeStealZ plugin.
  • Enum Constant Details

  • Method Details

    • values

      public static CustomItemType[] 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 CustomItemType 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
    • getType

      public String getType()
    • is

      public boolean is(org.bukkit.inventory.ItemStack item)
      Checks if the given ItemStack is of this CustomItemType.
      Parameters:
      item - the ItemStack to check
      Returns:
      true if the ItemStack is of this CustomItemType, false otherwise
    • fromString

      public static CustomItemType fromString(String type)
      Returns the CustomItemType corresponding to the given string.
      Parameters:
      type - the string representation of the custom item type
      Returns:
      the CustomItemType corresponding to the string, or NONE if not found
    • fromCustomItem

      public static CustomItemType fromCustomItem(String customItemId, org.bukkit.configuration.file.FileConfiguration config)
      Returns the CustomItemType for the given custom item ID from the configuration.
      Parameters:
      customItemId - the ID of the custom item
      config - the configuration file containing custom item definitions
      Returns:
      the CustomItemType for the given custom item ID, or NONE if not found