Record Class FindTopSurfaceFunction.Sampler
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.op.FindTopSurfaceFunction.Sampler
- All Implemented Interfaces:
DensitySampler
- Enclosing class:
FindTopSurfaceFunction
private static record FindTopSurfaceFunction.Sampler(DensitySampler density, DensitySampler upperBound, int lowerBound, int cellHeight)
extends Record
implements DensitySampler
-
Nested Class Summary
Nested classes/interfaces inherited from interface DensitySampler
DensitySampler.Bound -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thecellHeightrecord component.private final DensitySamplerThe field for thedensityrecord component.private final intThe field for thelowerBoundrecord component.private final DensitySamplerThe field for theupperBoundrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSampler(DensitySampler density, DensitySampler upperBound, int lowerBound, int cellHeight) Creates an instance of aSamplerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecellHeightrecord component.density()Returns the value of thedensityrecord component.final booleanIndicates whether some other object is "equal to" this one.private intfindSurfaceFrom(SamplerContext context, int x, int z, float upperBound) final inthashCode()Returns a hash code value for this object.intReturns the value of thelowerBoundrecord component.floatsampleValue(SamplerContext context, int blockX, int blockY, int blockZ) voidsampleVolume(SamplerContext context, DensityBuffer outputBuffer, DensityVolume volume) final StringtoString()Returns a string representation of this record class.Returns the value of theupperBoundrecord component.Methods inherited from interface DensitySampler
bind
-
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.
-
-
Constructor Details
-
Sampler
Creates an instance of aSamplerrecord 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
-
sampleVolume
- Specified by:
sampleVolumein interfaceDensitySampler
-
sampleValue
- Specified by:
sampleValuein interfaceDensitySampler
-
findSurfaceFrom
-
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
-