Record Class IntervalSelectFunction.Sampler
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.op.IntervalSelectFunction.Sampler
- All Implemented Interfaces:
DensitySampler
- Enclosing class:
IntervalSelectFunction
private static record IntervalSelectFunction.Sampler(DensitySampler input, float[] thresholds, DensitySampler[] samplers)
extends Record
implements DensitySampler
-
Nested Class Summary
Nested classes/interfaces inherited from interface DensitySampler
DensitySampler.Bound -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DensitySamplerThe field for theinputrecord component.private final DensitySampler[]The field for thesamplersrecord component.private final float[]The field for thethresholdsrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSampler(DensitySampler input, float[] thresholds, DensitySampler[] samplers) Creates an instance of aSamplerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.input()Returns the value of theinputrecord component.samplers()Returns the value of thesamplersrecord component.floatsampleValue(SamplerContext context, int blockX, int blockY, int blockZ) voidsampleVolume(SamplerContext context, DensityBuffer outputBuffer, DensityVolume volume) private intselectSamplerIndex(float input) float[]Returns the value of thethresholdsrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface DensitySampler
bind
-
Field Details
-
input
The field for theinputrecord component. -
thresholds
private final float[] thresholdsThe field for thethresholdsrecord component. -
samplers
The field for thesamplersrecord component.
-
-
Constructor Details
-
Sampler
Creates an instance of aSamplerrecord class.- Parameters:
input- the value for theinputrecord componentthresholds- the value for thethresholdsrecord componentsamplers- the value for thesamplersrecord component
-
-
Method Details
-
sampleVolume
- Specified by:
sampleVolumein interfaceDensitySampler
-
sampleValue
- Specified by:
sampleValuein interfaceDensitySampler
-
selectSamplerIndex
private int selectSamplerIndex(float input) -
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. All components in this record class are compared withObjects::equals(Object,Object). -
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
thresholds
public float[] thresholds()Returns the value of thethresholdsrecord component.- Returns:
- the value of the
thresholdsrecord component
-
samplers
Returns the value of thesamplersrecord component.- Returns:
- the value of the
samplersrecord component
-