Record Class EnchantmentLevelProvider
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.providers.number.EnchantmentLevelProvider
- All Implemented Interfaces:
LootContextUser,NumberProvider
public record EnchantmentLevelProvider(LevelBasedValue amount)
extends Record
implements NumberProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LevelBasedValueThe field for theamountrecord component.static final com.mojang.serialization.MapCodec<EnchantmentLevelProvider> -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aEnchantmentLevelProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionamount()Returns the value of theamountrecord component.final booleanIndicates whether some other object is "equal to" this one.static EnchantmentLevelProviderforEnchantmentLevel(LevelBasedValue p_343548_) floatgetFloat(LootContext p_344453_) getType()final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams, validateMethods inherited from interface net.minecraft.world.level.storage.loot.providers.number.NumberProvider
getInt
-
Field Details
-
amount
The field for theamountrecord component. -
CODEC
-
-
Constructor Details
-
EnchantmentLevelProvider
Creates an instance of aEnchantmentLevelProviderrecord class.- Parameters:
amount- the value for theamountrecord component
-
-
Method Details
-
getFloat
- Specified by:
getFloatin interfaceNumberProvider
-
getType
- Specified by:
getTypein interfaceNumberProvider
-
forEnchantmentLevel
-
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). -
amount
Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-