Record Class DensityFunctions.YClampedGradient
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.DensityFunctions.YClampedGradient
- All Implemented Interfaces:
DensityFunction
,DensityFunction.SimpleFunction
- Enclosing class:
- DensityFunctions
static record DensityFunctions.YClampedGradient(int fromY, int toY, double fromValue, double toValue)
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 TypeFieldDescriptionstatic final KeyDispatchDataCodec<DensityFunctions.YClampedGradient>
private static final com.mojang.serialization.MapCodec<DensityFunctions.YClampedGradient>
private final double
The field for thefromValue
record component.private final int
The field for thefromY
record component.private final double
The field for thetoValue
record component.private final int
The field for thetoY
record component.Fields inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DIRECT_CODEC, HOLDER_HELPER_CODEC
-
Constructor Summary
ConstructorDescriptionYClampedGradient
(int fromY, int toY, double fromValue, double toValue) Creates an instance of aYClampedGradient
record class. -
Method Summary
Modifier and TypeMethodDescriptionKeyDispatchDataCodec<? extends DensityFunction>
codec()
double
compute
(DensityFunction.FunctionContext p_208496_) final boolean
Indicates whether some other object is "equal to" this one.double
Returns the value of thefromValue
record component.int
fromY()
Returns the value of thefromY
record component.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
toValue()
Returns the value of thetoValue
record component.int
toY()
Returns the value of thetoY
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
fillArray, mapAll
-
Field Details
-
fromY
private final int fromYThe field for thefromY
record component. -
toY
private final int toYThe field for thetoY
record component. -
fromValue
private final double fromValueThe field for thefromValue
record component. -
toValue
private final double toValueThe field for thetoValue
record component. -
DATA_CODEC
private static final com.mojang.serialization.MapCodec<DensityFunctions.YClampedGradient> DATA_CODEC -
CODEC
-
-
Constructor Details
-
YClampedGradient
YClampedGradient(int fromY, int toY, double fromValue, double toValue) Creates an instance of aYClampedGradient
record class.- Parameters:
fromY
- the value for thefromY
record componenttoY
- the value for thetoY
record componentfromValue
- the value for thefromValue
record componenttoValue
- the value for thetoValue
record component
-
-
Method Details
-
compute
- Specified by:
compute
in interfaceDensityFunction
-
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 '=='. -
fromY
public int fromY()Returns the value of thefromY
record component.- Returns:
- the value of the
fromY
record component
-
toY
public int toY()Returns the value of thetoY
record component.- Returns:
- the value of the
toY
record component
-
fromValue
public double fromValue()Returns the value of thefromValue
record component.- Returns:
- the value of the
fromValue
record component
-
toValue
public double toValue()Returns the value of thetoValue
record component.- Returns:
- the value of the
toValue
record component
-