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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<LevelBasedValue.Lookup> private final LevelBasedValue
The field for thefallback
record component.The field for thevalues
record component.Fields inherited from interface net.minecraft.world.item.enchantment.LevelBasedValue
DISPATCH_CODEC
-
Constructor Summary
ConstructorDescriptionLookup
(List<Float> values, LevelBasedValue fallback) Creates an instance of aLookup
record class. -
Method Summary
Modifier and TypeMethodDescriptionfloat
calculate
(int p_352377_) com.mojang.serialization.MapCodec
<LevelBasedValue.Lookup> codec()
final boolean
Indicates whether some other object is "equal to" this one.fallback()
Returns the value of thefallback
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.values()
Returns the value of thevalues
record component.
-
Field Details
-
values
The field for thevalues
record component. -
fallback
The field for thefallback
record component. -
CODEC
-
-
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
-
calculate
public float calculate(int p_352377_) - Specified by:
calculate
in interfaceLevelBasedValue
-
codec
- Specified by:
codec
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
-