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 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 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.DensityFunctionDIRECT_CODEC, HOLDER_HELPER_CODEC
- 
Constructor SummaryConstructorsConstructorDescriptionYClampedGradient(int fromY, int toY, double fromValue, double toValue) Creates an instance of aYClampedGradientrecord class.
- 
Method SummaryModifier 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.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.SimpleFunctionfillArray, mapAll
- 
Field Details- 
fromYprivate final int fromYThe field for thefromYrecord component.
- 
toYprivate final int toYThe field for thetoYrecord component.
- 
fromValueprivate final double fromValueThe field for thefromValuerecord component.
- 
toValueprivate final double toValueThe field for thetoValuerecord component.
- 
DATA_CODECprivate static final com.mojang.serialization.MapCodec<DensityFunctions.YClampedGradient> DATA_CODEC
- 
CODEC
 
- 
- 
Constructor Details- 
YClampedGradientYClampedGradient(int fromY, int toY, double fromValue, double toValue) Creates an instance of aYClampedGradientrecord class.- Parameters:
- fromY- the value for the- fromYrecord component
- toY- the value for the- toYrecord component
- fromValue- the value for the- fromValuerecord component
- toValue- the value for the- toValuerecord component
 
 
- 
- 
Method Details- 
compute- Specified by:
- computein interface- DensityFunction
 
- 
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 '=='.
- 
fromYpublic int fromY()Returns the value of thefromYrecord component.- Returns:
- the value of the fromYrecord component
 
- 
toYpublic int toY()Returns the value of thetoYrecord component.- Returns:
- the value of the toYrecord component
 
- 
fromValuepublic double fromValue()Returns the value of thefromValuerecord component.- Returns:
- the value of the fromValuerecord component
 
- 
toValuepublic double toValue()Returns the value of thetoValuerecord component.- Returns:
- the value of the toValuerecord component
 
 
-