Record Class CurveFunction
java.lang.Object
java.lang.Record
com.lightning.northstar.planet.data.func.curve.CurveFunction
- All Implemented Interfaces:
LevelFunction
@ParametersAreNonnullByDefault
public record CurveFunction(LevelFunction key, CurveFunction.CurveDataFactory interpolation, Map<Float,LevelFunction> points, CurveFunction.LevelCurveData data)
extends Record
implements LevelFunction
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<CurveFunction> static final SimpleRegistry<String, CurveFunction.CurveDataFactory> static final net.minecraft.resources.ResourceLocationFields inherited from interface com.lightning.northstar.planet.data.func.LevelFunction
CODEC_NO_INLINE, REGISTRY -
Constructor Summary
ConstructorsConstructorDescriptionCurveFunction(LevelFunction key, CurveFunction.CurveDataFactory interpolation, Map<Float, LevelFunction> points, CurveFunction.LevelCurveData data) Creates an instance of aCurveFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondata()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.floatget(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) final inthashCode()Returns a hash code value for this object.Returns the value of theinterpolationrecord component.key()Returns the value of thekeyrecord component.points()Returns the value of thepointsrecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.resources.ResourceLocationtype()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.lightning.northstar.planet.data.func.LevelFunction
add, div, mul, sub
-
Field Details
-
FACTORIES
-
TYPE
public static final net.minecraft.resources.ResourceLocation TYPE -
CODEC
-
-
Constructor Details
-
CurveFunction
public CurveFunction(LevelFunction key, CurveFunction.CurveDataFactory interpolation, Map<Float, LevelFunction> points, CurveFunction.LevelCurveData data) Creates an instance of aCurveFunctionrecord class.- Parameters:
key- the value for thekeyrecord componentinterpolation- the value for theinterpolationrecord componentpoints- the value for thepointsrecord componentdata- the value for thedatarecord component
-
-
Method Details
-
type
public net.minecraft.resources.ResourceLocation type()- Specified by:
typein interfaceLevelFunction
-
get
public float get(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) - Specified by:
getin interfaceLevelFunction
-
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). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
interpolation
Returns the value of theinterpolationrecord component.- Returns:
- the value of the
interpolationrecord component
-
points
Returns the value of thepointsrecord component.- Returns:
- the value of the
pointsrecord component
-
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-