Record Class RangeChoiceFunction.ConstSampler
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.op.RangeChoiceFunction.ConstSampler
- All Implemented Interfaces:
DensitySampler
- Enclosing class:
RangeChoiceFunction
private static record RangeChoiceFunction.ConstSampler(DensitySampler input, float minInclusive, float maxExclusive, float whenInRange, float whenOutOfRange)
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 floatThe field for themaxExclusiverecord component.private final floatThe field for theminInclusiverecord component.private final floatThe field for thewhenInRangerecord component.private final floatThe field for thewhenOutOfRangerecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConstSampler(DensitySampler input, float minInclusive, float maxExclusive, float whenInRange, float whenOutOfRange) Creates an instance of aConstSamplerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionprivate floatchoose(float input) final 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.floatReturns the value of themaxExclusiverecord component.floatReturns the value of theminInclusiverecord 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.floatReturns the value of thewhenInRangerecord component.floatReturns the value of thewhenOutOfRangerecord component.Methods inherited from interface DensitySampler
bind
-
Field Details
-
input
The field for theinputrecord component. -
minInclusive
private final float minInclusiveThe field for theminInclusiverecord component. -
maxExclusive
private final float maxExclusiveThe field for themaxExclusiverecord component. -
whenInRange
private final float whenInRangeThe field for thewhenInRangerecord component. -
whenOutOfRange
private final float whenOutOfRangeThe field for thewhenOutOfRangerecord component.
-
-
Constructor Details
-
ConstSampler
private ConstSampler(DensitySampler input, float minInclusive, float maxExclusive, float whenInRange, float whenOutOfRange) Creates an instance of aConstSamplerrecord class.- Parameters:
input- the value for theinputrecord componentminInclusive- the value for theminInclusiverecord componentmaxExclusive- the value for themaxExclusiverecord componentwhenInRange- the value for thewhenInRangerecord componentwhenOutOfRange- the value for thewhenOutOfRangerecord component
-
-
Method Details
-
choose
private float choose(float input) -
sampleVolume
- Specified by:
sampleVolumein interfaceDensitySampler
-
sampleValue
- Specified by:
sampleValuein interfaceDensitySampler
-
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. -
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
minInclusive
public float minInclusive()Returns the value of theminInclusiverecord component.- Returns:
- the value of the
minInclusiverecord component
-
maxExclusive
public float maxExclusive()Returns the value of themaxExclusiverecord component.- Returns:
- the value of the
maxExclusiverecord component
-
whenInRange
public float whenInRange()Returns the value of thewhenInRangerecord component.- Returns:
- the value of the
whenInRangerecord component
-
whenOutOfRange
public float whenOutOfRange()Returns the value of thewhenOutOfRangerecord component.- Returns:
- the value of the
whenOutOfRangerecord component
-