Enum Class EnchantmentLevel

java.lang.Object
java.lang.Enum<EnchantmentLevel>
net.darkhax.bookshelf.common.api.data.enchantment.EnchantmentLevel
All Implemented Interfaces:
Serializable, Comparable<EnchantmentLevel>, Constable

public enum EnchantmentLevel extends Enum<EnchantmentLevel>
Calculates enchantment levels using different methods.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Returns the combined level of all matching enchantments.
    Returns the level of the first matching enchantment.
    Returns the highest level among all matching enchantments.
    Returns the lowest level among all matching enchantments.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    get(net.minecraft.tags.TagKey<net.minecraft.world.item.enchantment.Enchantment> enchType, net.minecraft.world.item.ItemStack stack)
    Gets the level of matching enchantments based on the calculation type.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • HIGHEST

      public static final EnchantmentLevel HIGHEST
      Returns the highest level among all matching enchantments.
    • LOWEST

      public static final EnchantmentLevel LOWEST
      Returns the lowest level among all matching enchantments.
    • FIRST

      public static final EnchantmentLevel FIRST
      Returns the level of the first matching enchantment.
    • CUMULATIVE

      public static final EnchantmentLevel CUMULATIVE
      Returns the combined level of all matching enchantments.
  • Method Details

    • values

      public static EnchantmentLevel[] 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 EnchantmentLevel 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
    • get

      public int get(net.minecraft.tags.TagKey<net.minecraft.world.item.enchantment.Enchantment> enchType, net.minecraft.world.item.ItemStack stack)
      Gets the level of matching enchantments based on the calculation type.
      Parameters:
      enchType - A tag of the enchantments to match on.
      stack - The item to test.
      Returns:
      The level based on the calculation type.