Record Class LevelBasedValue.Lookup
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.LevelBasedValue.Lookup
- All Implemented Interfaces:
LevelBasedValue
- Enclosing interface:
LevelBasedValue
public static record LevelBasedValue.Lookup(List<Float> values, LevelBasedValue fallback)
extends Record
implements LevelBasedValue
-
Nested Class Summary
Nested classes/interfaces inherited from interface LevelBasedValue
LevelBasedValue.Clamped, LevelBasedValue.Constant, LevelBasedValue.Exponent, LevelBasedValue.Fraction, LevelBasedValue.LevelsSquared, LevelBasedValue.Linear, LevelBasedValue.Lookup -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<LevelBasedValue.Lookup> private final LevelBasedValueThe field for thefallbackrecord component.The field for thevaluesrecord component.Fields inherited from interface LevelBasedValue
DISPATCH_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionLookup(List<Float> values, LevelBasedValue fallback) Creates an instance of aLookuprecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatcalculate(int level) com.mojang.serialization.MapCodec<LevelBasedValue.Lookup> codec()final booleanIndicates whether some other object is "equal to" this one.fallback()Returns the value of thefallbackrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.values()Returns the value of thevaluesrecord component.
-
Field Details
-
values
-
fallback
The field for thefallbackrecord component. -
CODEC
-
-
Constructor Details
-
Lookup
Creates an instance of aLookuprecord class.- Parameters:
values- the value for thevaluesrecord componentfallback- the value for thefallbackrecord component
-
-
Method Details
-
calculate
public float calculate(int level) - Specified by:
calculatein interfaceLevelBasedValue
-
codec
- Specified by:
codecin interfaceLevelBasedValue
-
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). -
values
-
fallback
Returns the value of thefallbackrecord component.- Returns:
- the value of the
fallbackrecord component
-