java.lang.Object
java.lang.Record
net.minestom.server.item.component.EnchantmentList
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec
<EnchantmentList> static final EnchantmentList
static final NetworkBuffer.Type
<EnchantmentList> -
Constructor Summary
ConstructorsConstructorDescriptionEnchantmentList
(Map<RegistryKey<Enchantment>, Integer> enchantments) Creates an instance of aEnchantmentList
record class.EnchantmentList
(RegistryKey<Enchantment> enchantment, int level) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theenchantments
record component.final boolean
Indicates whether some other object is "equal to" this one.boolean
has
(RegistryKey<Enchantment> enchantment) final int
hashCode()
Returns a hash code value for this object.int
level
(RegistryKey<Enchantment> enchantment) remove
(RegistryKey<Enchantment> enchantment) final String
toString()
Returns a string representation of this record class.with
(RegistryKey<Enchantment> enchantment, int level)
-
Field Details
-
EMPTY
-
NETWORK_TYPE
-
CODEC
-
-
Constructor Details
-
EnchantmentList
Creates an instance of aEnchantmentList
record class.- Parameters:
enchantments
- the value for theenchantments
record component
-
EnchantmentList
-
-
Method Details
-
has
-
level
-
with
-
remove
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
enchantments
Returns the value of theenchantments
record component.- Returns:
- the value of the
enchantments
record component
-