Record Class EnchantmentList
java.lang.Object
java.lang.Record
net.minestom.server.item.component.EnchantmentList
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<EnchantmentList> static final EnchantmentListstatic final NetworkBuffer.Type<EnchantmentList> -
Constructor Summary
ConstructorsConstructorDescriptionEnchantmentList(Map<RegistryKey<Enchantment>, Integer> enchantments) Creates an instance of aEnchantmentListrecord class.EnchantmentList(RegistryKey<Enchantment> enchantment, int level) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theenchantmentsrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanhas(RegistryKey<Enchantment> enchantment) final inthashCode()Returns a hash code value for this object.intlevel(RegistryKey<Enchantment> enchantment) remove(RegistryKey<Enchantment> enchantment) final StringtoString()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 aEnchantmentListrecord class.- Parameters:
enchantments- the value for theenchantmentsrecord component
-
EnchantmentList
-
-
Method Details
-
has
-
level
-
with
-
remove
-
toString
-
hashCode
-
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 theenchantmentsrecord component.- Returns:
- the value of the
enchantmentsrecord component
-