Record Class DensityFunctions.FindTopSurface
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.DensityFunctions.FindTopSurface
- All Implemented Interfaces:
DensityFunction
- Enclosing class:
DensityFunctions
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 net.minecraft.world.level.levelgen.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 net.minecraft.world.level.levelgen.DensityFunction
DIRECT_CODEC, HOLDER_HELPER_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionFindTopSurface(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 p_434519_) density()Returns the value of thedensityrecord component.final booleanIndicates whether some other object is "equal to" this one.voidfillArray(double[] p_435166_, DensityFunction.ContextProvider p_434289_) final inthashCode()Returns a hash code value for this object.intReturns the value of thelowerBoundrecord component.mapAll(DensityFunction.Visitor p_434292_) doublemaxValue()doubleminValue()final StringtoString()Returns a string representation of this record class.Returns the value of theupperBoundrecord 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, 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
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
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
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
-