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
static record DensityFunctions.Constant(double value)
extends Record
implements DensityFunction.SimpleFunction
- 
Nested Class SummaryNested classes/interfaces inherited from interface net.minecraft.world.level.levelgen.DensityFunctionDensityFunction.ContextProvider, DensityFunction.FunctionContext, DensityFunction.NoiseHolder, DensityFunction.SimpleFunction, DensityFunction.SinglePointContext, DensityFunction.Visitor
- 
Field SummaryFieldsModifier and TypeFieldDescription(package private) static final KeyDispatchDataCodec<DensityFunctions.Constant>private final doubleThe field for thevaluerecord component.(package private) static final DensityFunctions.ConstantFields inherited from interface net.minecraft.world.level.levelgen.DensityFunctionDIRECT_CODEC, HOLDER_HELPER_CODEC
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionKeyDispatchDataCodec<? extends DensityFunction>codec()doublecompute(DensityFunction.FunctionContext p_208615_) final booleanIndicates whether some other object is "equal to" this one.voidfillArray(double[] p_208617_, DensityFunction.ContextProvider p_208618_) 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 class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.levelgen.DensityFunctionabs, clamp, cube, halfNegative, quarterNegative, square, squeezeMethods inherited from interface net.minecraft.world.level.levelgen.DensityFunction.SimpleFunctionmapAll
- 
Field Details- 
valueprivate final double valueThe field for thevaluerecord component.
- 
CODEC
- 
ZERO
 
- 
- 
Constructor Details- 
ConstantConstant(double value) Creates an instance of aConstantrecord class.- Parameters:
- value- the value for the- valuerecord component
 
 
- 
- 
Method Details- 
compute- Specified by:
- computein interface- DensityFunction
 
- 
fillArray- Specified by:
- fillArrayin interface- DensityFunction
- Specified by:
- fillArrayin interface- DensityFunction.SimpleFunction
 
- 
minValuepublic double minValue()- Specified by:
- minValuein interface- DensityFunction
 
- 
maxValuepublic double maxValue()- Specified by:
- maxValuein interface- DensityFunction
 
- 
codec- Specified by:
- codecin interface- DensityFunction
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 '=='.
- 
valuepublic double value()Returns the value of thevaluerecord component.- Returns:
- the value of the valuerecord component
 
 
-