Package net.minestom.server.item.enchant
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(@NotNull List<Float> values, @NotNull LevelBasedValue fallback)
extends Record
implements LevelBasedValue
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minestom.server.item.enchant.LevelBasedValue
LevelBasedValue.Clamped, LevelBasedValue.Constant, LevelBasedValue.Fraction, LevelBasedValue.LevelsSquared, LevelBasedValue.Linear, LevelBasedValue.Lookup
-
Field Summary
FieldsFields inherited from interface net.minestom.server.item.enchant.LevelBasedValue
TAGGED_NBT_TYPE
-
Constructor Summary
ConstructorsConstructorDescriptionLookup
(@NotNull List<Float> values, @NotNull LevelBasedValue fallback) Creates an instance of aLookup
record class. -
Method Summary
Modifier and TypeMethodDescriptionfloat
calc
(int level) final boolean
Indicates whether some other object is "equal to" this one.@NotNull LevelBasedValue
fallback()
Returns the value of thefallback
record component.final int
hashCode()
Returns a hash code value for this object.@NotNull BinaryTagSerializer
<LevelBasedValue.Lookup> nbtType()
final String
toString()
Returns a string representation of this record class.values()
Returns the value of thevalues
record component.
-
Field Details
-
NBT_TYPE
-
-
Constructor Details
-
Lookup
Creates an instance of aLookup
record class.- Parameters:
values
- the value for thevalues
record componentfallback
- the value for thefallback
record component
-
-
Method Details
-
calc
public float calc(int level) - Specified by:
calc
in interfaceLevelBasedValue
-
nbtType
- Specified by:
nbtType
in 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 thevalues
record component.- Returns:
- the value of the
values
record component
-
fallback
Returns the value of thefallback
record component.- Returns:
- the value of the
fallback
record component
-