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
FieldsModifier and TypeFieldDescriptionstatic final KeyDispatchDataCodec<DensityFunctions.YClampedGradient>private static final com.mojang.serialization.MapCodec<DensityFunctions.YClampedGradient>private final doubleThe field for thefromValuerecord component.private final intThe field for thefromYrecord component.private final doubleThe field for thetoValuerecord component.private final intThe field for thetoYrecord component.Fields inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DIRECT_CODEC, HOLDER_HELPER_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionYClampedGradient(int fromY, int toY, double fromValue, double toValue) Creates an instance of aYClampedGradientrecord class. -
Method Summary
Modifier and TypeMethodDescriptionKeyDispatchDataCodec<? extends DensityFunction>codec()doublecompute(DensityFunction.FunctionContext p_208496_) final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of thefromValuerecord component.intfromY()Returns the value of thefromYrecord component.final inthashCode()Returns a hash code value for this object.doublemaxValue()doubleminValue()final StringtoString()Returns a string representation of this record class.doubletoValue()Returns the value of thetoValuerecord component.inttoY()Returns the value of thetoYrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.levelgen.DensityFunction
abs, clamp, cube, halfNegative, quarterNegative, square, squeezeMethods inherited from interface net.minecraft.world.level.levelgen.DensityFunction.SimpleFunction
fillArray, mapAll
-
Field Details
-
fromY
private final int fromYThe field for thefromYrecord component. -
toY
private final int toYThe field for thetoYrecord component. -
fromValue
private final double fromValueThe field for thefromValuerecord component. -
toValue
private final double toValueThe field for thetoValuerecord 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 aYClampedGradientrecord class.- Parameters:
fromY- the value for thefromYrecord componenttoY- the value for thetoYrecord componentfromValue- the value for thefromValuerecord componenttoValue- the value for thetoValuerecord component
-
-
Method Details
-
compute
- Specified by:
computein interfaceDensityFunction
-
minValue
public double minValue()- Specified by:
minValuein interfaceDensityFunction
-
maxValue
public double maxValue()- Specified by:
maxValuein interfaceDensityFunction
-
codec
- Specified by:
codecin 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 thefromYrecord component.- Returns:
- the value of the
fromYrecord component
-
toY
public int toY()Returns the value of thetoYrecord component.- Returns:
- the value of the
toYrecord component
-
fromValue
public double fromValue()Returns the value of thefromValuerecord component.- Returns:
- the value of the
fromValuerecord component
-
toValue
public double toValue()Returns the value of thetoValuerecord component.- Returns:
- the value of the
toValuerecord component
-