Record Class GradientFunction
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.generator.GradientFunction
- All Implemented Interfaces:
DensityFunction
public record GradientFunction(Direction.Axis axis, TilingMode tiling, int fromCoordinate, int toCoordinate, float fromValue, float toValue)
extends Record
implements DensityFunction
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordprivate static interfaceprivate static final recordprivate static final recordNested classes/interfaces inherited from interface DensityFunction
DensityFunction.Axes, DensityFunction.CompileContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Direction.AxisThe field for theaxisrecord component.static final com.mojang.serialization.MapCodec<GradientFunction> private final intThe field for thefromCoordinaterecord component.private final floatThe field for thefromValuerecord component.private final TilingModeThe field for thetilingrecord component.private final intThe field for thetoCoordinaterecord component.private final floatThe field for thetoValuerecord component.Fields inherited from interface DensityFunction
ALL_AXES, AXIS_X, AXIS_Y, AXIS_Z, NO_AXES, REFERENCE_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionGradientFunction(Direction.Axis axis, TilingMode tiling, int fromCoordinate, int toCoordinate, float fromValue, float toValue) Creates an instance of aGradientFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaxis()Returns the value of theaxisrecord component.com.mojang.serialization.MapCodec<GradientFunction> codec()intfinal booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefromCoordinaterecord component.floatReturns the value of thefromValuerecord component.final inthashCode()Returns a hash code value for this object.range()rewriteChildren(DfRewriteRule rule) tiling()Returns the value of thetilingrecord component.intReturns the value of thetoCoordinaterecord component.final StringtoString()Returns a string representation of this record class.floattoValue()Returns the value of thetoValuerecord component.private static com.mojang.serialization.DataResult<GradientFunction> validate(GradientFunction gradient)
-
Field Details
-
axis
The field for theaxisrecord component. -
tiling
The field for thetilingrecord component. -
fromCoordinate
private final int fromCoordinateThe field for thefromCoordinaterecord component. -
toCoordinate
private final int toCoordinateThe field for thetoCoordinaterecord component. -
fromValue
private final float fromValueThe field for thefromValuerecord component. -
toValue
private final float toValueThe field for thetoValuerecord component. -
CODEC
-
-
Constructor Details
-
GradientFunction
public GradientFunction(Direction.Axis axis, TilingMode tiling, int fromCoordinate, int toCoordinate, float fromValue, float toValue) Creates an instance of aGradientFunctionrecord class.- Parameters:
axis- the value for theaxisrecord componenttiling- the value for thetilingrecord componentfromCoordinate- the value for thefromCoordinaterecord componenttoCoordinate- the value for thetoCoordinaterecord componentfromValue- the value for thefromValuerecord componenttoValue- the value for thetoValuerecord component
-
-
Method Details
-
validate
private static com.mojang.serialization.DataResult<GradientFunction> validate(GradientFunction gradient) -
compileSampler
- Specified by:
compileSamplerin interfaceDensityFunction
-
range
- Specified by:
rangein interfaceDensityFunction
-
domainAxes
public int domainAxes()- Specified by:
domainAxesin interfaceDensityFunction
-
codec
- Specified by:
codecin interfaceDensityFunction
-
rewriteChildren
- Specified by:
rewriteChildrenin interfaceDensityFunction
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
axis
Returns the value of theaxisrecord component.- Returns:
- the value of the
axisrecord component
-
tiling
Returns the value of thetilingrecord component.- Returns:
- the value of the
tilingrecord component
-
fromCoordinate
public int fromCoordinate()Returns the value of thefromCoordinaterecord component.- Returns:
- the value of the
fromCoordinaterecord component
-
toCoordinate
public int toCoordinate()Returns the value of thetoCoordinaterecord component.- Returns:
- the value of the
toCoordinaterecord component
-
fromValue
public float fromValue()Returns the value of thefromValuerecord component.- Returns:
- the value of the
fromValuerecord component
-
toValue
public float toValue()Returns the value of thetoValuerecord component.- Returns:
- the value of the
toValuerecord component
-