Record Class DensityFunctions.Spline
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.DensityFunctions.Spline
- All Implemented Interfaces:
DensityFunction
- Enclosing class:
- DensityFunctions
public static record DensityFunctions.Spline(CubicSpline<TerrainShaper.PointCustom> spline, double minValue, double maxValue)
extends Record
implements DensityFunction
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DensityFunction.ContextProvider, DensityFunction.FunctionContext, DensityFunction.SimpleFunction, DensityFunction.SinglePointContext, DensityFunction.Visitor
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DensityFunctions.Spline>
private static final com.mojang.serialization.MapCodec<DensityFunctions.Spline>
private final double
The field for themaxValue
record component.private final double
The field for theminValue
record component.private final CubicSpline<TerrainShaper.PointCustom>
The field for thespline
record component.Fields inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DIRECT_CODEC, HOLDER_HELPER_CODEC
-
Constructor Summary
ConstructorDescriptionSpline
(CubicSpline<TerrainShaper.PointCustom> spline, double minValue, double maxValue) Creates an instance of aSpline
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<? extends DensityFunction>
codec()
double
compute
(DensityFunction.FunctionContext p_211715_) final boolean
Indicates whether some other object is "equal to" this one.void
fillArray
(double[] p_211722_, DensityFunction.ContextProvider p_211723_) final int
hashCode()
Returns a hash code value for this object.mapAll
(DensityFunction.Visitor p_211717_) double
maxValue()
Returns the value of themaxValue
record component.double
minValue()
Returns the value of theminValue
record component.spline()
Returns the value of thespline
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.level.levelgen.DensityFunction
abs, clamp, cube, halfNegative, quarterNegative, square, squeeze
-
Field Details
-
spline
The field for thespline
record component. -
minValue
private final double minValueThe field for theminValue
record component. -
maxValue
private final double maxValueThe field for themaxValue
record component. -
DATA_CODEC
-
CODEC
-
-
Constructor Details
-
Spline
Creates an instance of aSpline
record class.- Parameters:
spline
- the value for thespline
record componentminValue
- the value for theminValue
record componentmaxValue
- the value for themaxValue
record component
-
-
Method Details
-
compute
- Specified by:
compute
in interfaceDensityFunction
-
fillArray
- Specified by:
fillArray
in interfaceDensityFunction
-
mapAll
- Specified by:
mapAll
in interfaceDensityFunction
-
codec
- Specified by:
codec
in interfaceDensityFunction
-
minValue
public double minValue()Returns the value of theminValue
record component.- Specified by:
minValue
in interfaceDensityFunction
- Returns:
- the value of the
minValue
record component
-
maxValue
public double maxValue()Returns the value of themaxValue
record component.- Specified by:
maxValue
in interfaceDensityFunction
- Returns:
- the value of the
maxValue
record component
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
spline
Returns the value of thespline
record component.- Returns:
- the value of the
spline
record component
-