Enum Class EnchantmentTableProperty

java.lang.Object
java.lang.Enum<EnchantmentTableProperty>
org.geysermc.mcprotocollib.protocol.data.game.inventory.property.EnchantmentTableProperty
All Implemented Interfaces:
Serializable, Comparable<EnchantmentTableProperty>, Constable, ContainerProperty

public enum EnchantmentTableProperty extends Enum<EnchantmentTableProperty> implements ContainerProperty
Container properties of an enchantment table.
  • Enum Constant Details

  • Method Details

    • values

      public static EnchantmentTableProperty[] 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 EnchantmentTableProperty 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
    • from

      public static EnchantmentTableProperty from(int id)
    • getEnchantment

      public static int getEnchantment(int type, int level)
      Packs enchantment type and level into one integer as used for the ENCHANTMENT_SLOT_X properties.
      Parameters:
      type - Id of the enchantment
      level - Level of the enchantment
      Returns:
      Packed value
      See Also:
    • getEnchantmentType

      public static int getEnchantmentType(int enchantmentInfo)
      Unpacks the enchantment type from one integer as used for the ENCHANTMENT_SLOT_X properties.
      Parameters:
      enchantmentInfo - Packed value
      Returns:
      Id of the enchantment
      See Also:
    • getEnchantmentLevel

      public static int getEnchantmentLevel(int enchantmentInfo)
      Unpacks the enchantment level from one integer as used for the ENCHANTMENT_SLOT_X properties.
      Parameters:
      enchantmentInfo - Packed value
      Returns:
      Level of the enchantment
      See Also: