Record Class ConstantFunction
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.generator.ConstantFunction
- All Implemented Interfaces:
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<ConstantFunction> private final floatThe field for thevaluerecord component.Fields inherited from interface DensityFunction
ALL_AXES, AXIS_X, AXIS_Y, AXIS_Z, NO_AXES, REFERENCE_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionConstantFunction(float value) Creates an instance of aConstantFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<ConstantFunction> codec()intfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.range()rewriteChildren(DfRewriteRule rule) final StringtoString()Returns a string representation of this record class.floatvalue()Returns the value of thevaluerecord component.
-
Field Details
-
value
private final float valueThe field for thevaluerecord component. -
CODEC
-
-
Constructor Details
-
ConstantFunction
public ConstantFunction(float value) Creates an instance of aConstantFunctionrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
value
public float value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-