Record Class RangeChoiceFunction
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.op.RangeChoiceFunction
- All Implemented Interfaces:
DensityFunction
public record RangeChoiceFunction(DensityFunction input, float minInclusive, float maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange)
extends Record
implements DensityFunction
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordprivate static final recordNested classes/interfaces inherited from interface DensityFunction
DensityFunction.Axes, DensityFunction.CompileContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<RangeChoiceFunction> private final DensityFunctionThe field for theinputrecord component.private final floatThe field for themaxExclusiverecord component.private final floatThe field for theminInclusiverecord component.private final DensityFunctionThe field for thewhenInRangerecord component.private final DensityFunctionThe field for thewhenOutOfRangerecord component.Fields inherited from interface DensityFunction
ALL_AXES, AXIS_X, AXIS_Y, AXIS_Z, NO_AXES, REFERENCE_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionRangeChoiceFunction(DensityFunction input, float minInclusive, float maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Creates an instance of aRangeChoiceFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<RangeChoiceFunction> codec()intfinal 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.range()rewriteChildren(DfRewriteRule rule) final StringtoString()Returns a string representation of this record class.Returns the value of thewhenInRangerecord component.Returns the value of thewhenOutOfRangerecord component.
-
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
The field for thewhenInRangerecord component. -
whenOutOfRange
The field for thewhenOutOfRangerecord component. -
CODEC
-
-
Constructor Details
-
RangeChoiceFunction
public RangeChoiceFunction(DensityFunction input, float minInclusive, float maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Creates an instance of aRangeChoiceFunctionrecord 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
-
compileSampler
- Specified by:
compileSamplerin interfaceDensityFunction
-
rewriteChildren
- Specified by:
rewriteChildrenin interfaceDensityFunction
-
range
- Specified by:
rangein interfaceDensityFunction
-
domainAxes
public int domainAxes()- Specified by:
domainAxesin 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. -
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
Returns the value of thewhenInRangerecord component.- Returns:
- the value of the
whenInRangerecord component
-
whenOutOfRange
Returns the value of thewhenOutOfRangerecord component.- Returns:
- the value of the
whenOutOfRangerecord component
-