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 net.minecraft.world.item.enchantment.LevelBasedValue
LevelBasedValue.Clamped, LevelBasedValue.Constant, 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 net.minecraft.world.item.enchantment.LevelBasedValue
DISPATCH_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionLookup(List<Float> values, LevelBasedValue fallback) Creates an instance of aLookuprecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatcalculate(int p_342461_) 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
The field for thevaluesrecord component. -
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 p_342461_) - Specified by:
calculatein interfaceLevelBasedValue
-
codec
- Specified by:
codecin interfaceLevelBasedValue
-
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). -
values
Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-
fallback
Returns the value of thefallbackrecord component.- Returns:
- the value of the
fallbackrecord component
-