Record Class LevelBasedValue.Lookup
java.lang.Object
java.lang.Record
net.minestom.server.item.enchant.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.Fraction, LevelBasedValue.LevelsSquared, LevelBasedValue.Linear, LevelBasedValue.Lookup -
Field Summary
FieldsFields inherited from interface LevelBasedValue
TAGGED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionLookup(List<Float> values, LevelBasedValue fallback) Creates an instance of aLookuprecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatcalc(int level) 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
-
CODEC
-
-
Constructor Details
-
Lookup
Creates an instance of aLookuprecord class.- Parameters:
values- the value for thevaluesrecord componentfallback- the value for thefallbackrecord component
-
-
Method Details
-
calc
public float calc(int level) - Specified by:
calcin 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
-