Record Class ClampFunction
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.op.ClampFunction
- All Implemented Interfaces:
DensityFunction
public record ClampFunction(DensityFunction input, float min, float max)
extends Record
implements DensityFunction
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface DensityFunction
DensityFunction.Axes, DensityFunction.CompileContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ClampFunction> private final DensityFunctionThe field for theinputrecord component.private final floatThe field for themaxrecord component.private final floatThe field for theminrecord component.Fields inherited from interface DensityFunction
ALL_AXES, AXIS_X, AXIS_Y, AXIS_Z, NO_AXES, REFERENCE_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionClampFunction(DensityFunction input, float min, float max) Creates an instance of aClampFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<ClampFunction> codec()intfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.input()Returns the value of theinputrecord component.floatmax()Returns the value of themaxrecord component.floatmin()Returns the value of theminrecord component.range()rewriteChildren(DfRewriteRule rule) final StringtoString()Returns a string representation of this record class.private static com.mojang.serialization.DataResult<ClampFunction> validate(ClampFunction clamp)
-
Field Details
-
input
The field for theinputrecord component. -
min
private final float minThe field for theminrecord component. -
max
private final float maxThe field for themaxrecord component. -
CODEC
-
-
Constructor Details
-
ClampFunction
Creates an instance of aClampFunctionrecord class.- Parameters:
input- the value for theinputrecord componentmin- the value for theminrecord componentmax- the value for themaxrecord component
-
-
Method Details
-
validate
-
compileSampler
- Specified by:
compileSamplerin interfaceDensityFunction
-
rewriteChildren
- Specified by:
rewriteChildrenin interfaceDensityFunction
-
codec
- Specified by:
codecin interfaceDensityFunction
-
range
- Specified by:
rangein interfaceDensityFunction
-
domainAxes
public int domainAxes()- Specified by:
domainAxesin 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. -
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
min
public float min()Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
public float max()Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-