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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe enchantment for slot 1.The enchantment for slot 2.The enchantment for slot 3.Level of the enchantment in slot 1.Level of the enchantment in slot 2.Level of the enchantment in slot 3.The seed used for the next enchantment. -
Method Summary
Modifier and TypeMethodDescriptionstatic EnchantmentTablePropertyfrom(int id) static intgetEnchantment(int type, int level) Packs enchantment type and level into one integer as used for the ENCHANTMENT_SLOT_X properties.static intgetEnchantmentLevel(int enchantmentInfo) Unpacks the enchantment level from one integer as used for the ENCHANTMENT_SLOT_X properties.static intgetEnchantmentType(int enchantmentInfo) Unpacks the enchantment type from one integer as used for the ENCHANTMENT_SLOT_X properties.static EnchantmentTablePropertyReturns the enum constant of this class with the specified name.static EnchantmentTableProperty[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface org.geysermc.mcprotocollib.protocol.data.game.inventory.property.ContainerProperty
ordinal
-
Enum Constant Details
-
LEVEL_SLOT_1
Level of the enchantment in slot 1. -
LEVEL_SLOT_2
Level of the enchantment in slot 2. -
LEVEL_SLOT_3
Level of the enchantment in slot 3. -
XP_SEED
The seed used for the next enchantment. -
ENCHANTMENT_SLOT_1
The enchantment for slot 1.- See Also:
-
ENCHANTMENT_SLOT_2
The enchantment for slot 2.- See Also:
-
ENCHANTMENT_SLOT_3
The enchantment for slot 3.- See Also:
-
-
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
-
from
-
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 enchantmentlevel- 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:
-