Record Class DensityFunctions.FindTopSurface
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.DensityFunctions.FindTopSurface
- All Implemented Interfaces:
DensityFunction
- Enclosing class:
DensityFunctions
private static record DensityFunctions.FindTopSurface(DensityFunction density, DensityFunction upperBound, int lowerBound, int cellHeight)
extends Record
implements DensityFunction
-
Nested Class Summary
Nested classes/interfaces inherited from interface DensityFunction
DensityFunction.ContextProvider, DensityFunction.FunctionContext, DensityFunction.NoiseHolder, DensityFunction.SimpleFunction, DensityFunction.SinglePointContext, DensityFunction.Visitor -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thecellHeightrecord component.static final KeyDispatchDataCodec<DensityFunctions.FindTopSurface> private static final com.mojang.serialization.MapCodec<DensityFunctions.FindTopSurface> private final DensityFunctionThe field for thedensityrecord component.private final intThe field for thelowerBoundrecord component.private final DensityFunctionThe field for theupperBoundrecord component.Fields inherited from interface DensityFunction
DIRECT_CODEC, HOLDER_HELPER_CODEC -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateFindTopSurface(DensityFunction density, DensityFunction upperBound, int lowerBound, int cellHeight) Creates an instance of aFindTopSurfacerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecellHeightrecord component.KeyDispatchDataCodec<? extends DensityFunction> codec()doublecompute(DensityFunction.FunctionContext context) density()Returns the value of thedensityrecord component.final booleanIndicates whether some other object is "equal to" this one.voidfillArray(double[] output, DensityFunction.ContextProvider contextProvider) final inthashCode()Returns a hash code value for this object.intReturns the value of thelowerBoundrecord component.mapAll(DensityFunction.Visitor visitor) doublemaxValue()doubleminValue()final StringtoString()Returns a string representation of this record class.Returns the value of theupperBoundrecord component.Methods inherited from interface DensityFunction
abs, clamp, cube, halfNegative, invert, quarterNegative, square, squeeze
-
Field Details
-
density
The field for thedensityrecord component. -
upperBound
The field for theupperBoundrecord component. -
lowerBound
private final int lowerBoundThe field for thelowerBoundrecord component. -
cellHeight
private final int cellHeightThe field for thecellHeightrecord component. -
DATA_CODEC
-
CODEC
-
-
Constructor Details
-
FindTopSurface
private FindTopSurface(DensityFunction density, DensityFunction upperBound, int lowerBound, int cellHeight) Creates an instance of aFindTopSurfacerecord class.- Parameters:
density- the value for thedensityrecord componentupperBound- the value for theupperBoundrecord componentlowerBound- the value for thelowerBoundrecord componentcellHeight- the value for thecellHeightrecord component
-
-
Method Details
-
compute
- Specified by:
computein interfaceDensityFunction
-
fillArray
- Specified by:
fillArrayin interfaceDensityFunction
-
mapAll
- Specified by:
mapAllin interfaceDensityFunction
-
minValue
public double minValue()- Specified by:
minValuein interfaceDensityFunction
-
maxValue
public double maxValue()- Specified by:
maxValuein interfaceDensityFunction
-
codec
- Specified by:
codecin interfaceDensityFunction
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
density
Returns the value of thedensityrecord component.- Returns:
- the value of the
densityrecord component
-
upperBound
Returns the value of theupperBoundrecord component.- Returns:
- the value of the
upperBoundrecord component
-
lowerBound
public int lowerBound()Returns the value of thelowerBoundrecord component.- Returns:
- the value of the
lowerBoundrecord component
-
cellHeight
public int cellHeight()Returns the value of thecellHeightrecord component.- Returns:
- the value of the
cellHeightrecord component
-