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 Summary
Nested classes/interfaces inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DensityFunction.ContextProvider, DensityFunction.FunctionContext, DensityFunction.NoiseHolder, DensityFunction.SimpleFunction, DensityFunction.SinglePointContext, DensityFunction.Visitor
-
Field Summary
Modifier and TypeFieldDescription(package private) static final KeyDispatchDataCodec<DensityFunctions.Constant>
private final double
The field for thevalue
record component.(package private) static final DensityFunctions.Constant
Fields inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DIRECT_CODEC, HOLDER_HELPER_CODEC
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionKeyDispatchDataCodec<? extends DensityFunction>
codec()
double
compute
(DensityFunction.FunctionContext p_208615_) final boolean
Indicates whether some other object is "equal to" this one.void
fillArray
(double[] p_208617_, DensityFunction.ContextProvider p_208618_) final int
hashCode()
Returns a hash code value for this object.double
maxValue()
double
minValue()
final String
toString()
Returns a string representation of this record class.double
value()
Returns the value of thevalue
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.level.levelgen.DensityFunction
abs, clamp, cube, halfNegative, quarterNegative, square, squeeze
Methods inherited from interface net.minecraft.world.level.levelgen.DensityFunction.SimpleFunction
mapAll
-
Field Details
-
value
private final double valueThe field for thevalue
record component. -
CODEC
-
ZERO
-
-
Constructor Details
-
Constant
Constant(double value) Creates an instance of aConstant
record class.- Parameters:
value
- the value for thevalue
record component
-
-
Method Details
-
compute
- Specified by:
compute
in interfaceDensityFunction
-
fillArray
- Specified by:
fillArray
in interfaceDensityFunction
- Specified by:
fillArray
in interfaceDensityFunction.SimpleFunction
-
minValue
public double minValue()- Specified by:
minValue
in interfaceDensityFunction
-
maxValue
public double maxValue()- Specified by:
maxValue
in interfaceDensityFunction
-
codec
- Specified by:
codec
in interfaceDensityFunction
-
toString
Returns 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. -
hashCode
public 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. -
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 '=='. -
value
public double value()Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-