Record Class DensityFunctions.Constant
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.DensityFunctions.Constant
- All Implemented Interfaces:
DensityFunction, DensityFunction.SimpleFunction
- Enclosing class:
DensityFunctions
private static record DensityFunctions.Constant(double value)
extends Record
implements DensityFunction.SimpleFunction
-
Nested Class Summary
Nested classes/interfaces inherited from interface DensityFunction
DensityFunction.ContextProvider, DensityFunction.FunctionContext, DensityFunction.NoiseHolder, DensityFunction.SimpleFunction, DensityFunction.SinglePointContext, DensityFunction.Visitor -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final KeyDispatchDataCodec<DensityFunctions.Constant> private final doubleThe field for thevaluerecord component.private static final DensityFunctions.ConstantFields inherited from interface DensityFunction
DIRECT_CODEC, HOLDER_HELPER_CODEC -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConstant(double value) Creates an instance of aConstantrecord class. -
Method Summary
Modifier and TypeMethodDescriptionKeyDispatchDataCodec<? extends DensityFunction> codec()doublecompute(DensityFunction.FunctionContext context) final booleanIndicates whether some other object is "equal to" this one.voidfillArray(double[] output, DensityFunction.ContextProvider contextProvider) final inthashCode()Returns a hash code value for this object.doublemaxValue()doubleminValue()final StringtoString()Returns a string representation of this record class.doublevalue()Returns the value of thevaluerecord component.Methods inherited from interface DensityFunction
abs, clamp, cube, halfNegative, invert, quarterNegative, square, squeezeMethods inherited from interface DensityFunction.SimpleFunction
mapAll
-
Field Details
-
value
private final double valueThe field for thevaluerecord component. -
CODEC
-
ZERO
-
-
Constructor Details
-
Constant
private Constant(double value) Creates an instance of aConstantrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
compute
- Specified by:
computein interfaceDensityFunction
-
fillArray
- Specified by:
fillArrayin interfaceDensityFunction- Specified by:
fillArrayin interfaceDensityFunction.SimpleFunction
-
minValue
public double minValue()- Specified by:
minValuein interfaceDensityFunction
-
maxValue
public double maxValue()- Specified by:
maxValuein interfaceDensityFunction
-
codec
- Specified by:
codecin 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 double value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-