Record Class DensityFunctions.RangeChoice
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.DensityFunctions.RangeChoice
- All Implemented Interfaces:
DensityFunction
- Enclosing class:
- DensityFunctions
static record DensityFunctions.RangeChoice(DensityFunction input, double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange)
extends Record
implements DensityFunction
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DensityFunction.ContextProvider, DensityFunction.FunctionContext, DensityFunction.SimpleFunction, DensityFunction.SinglePointContext, DensityFunction.Visitor -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DensityFunctions.RangeChoice>static final com.mojang.serialization.MapCodec<DensityFunctions.RangeChoice>private final DensityFunctionThe field for theinputrecord component.private final doubleThe field for themaxExclusiverecord component.private final doubleThe field for theminInclusiverecord component.private final DensityFunctionThe field for thewhenInRangerecord component.private final DensityFunctionThe field for thewhenOutOfRangerecord component.Fields inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DIRECT_CODEC, HOLDER_HELPER_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionRangeChoice(DensityFunction input, double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Creates an instance of aRangeChoicerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<? extends DensityFunction>codec()doublecompute(DensityFunction.FunctionContext p_208839_) final booleanIndicates whether some other object is "equal to" this one.voidfillArray(double[] p_208843_, DensityFunction.ContextProvider p_208844_) final inthashCode()Returns a hash code value for this object.input()Returns the value of theinputrecord component.mapAll(DensityFunction.Visitor p_208841_) doubleReturns the value of themaxExclusiverecord component.doublemaxValue()doubleReturns the value of theminInclusiverecord component.doubleminValue()final StringtoString()Returns a string representation of this record class.Returns the value of thewhenInRangerecord component.Returns the value of thewhenOutOfRangerecord 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, quarterNegative, square, squeeze
-
Field Details
-
input
The field for theinputrecord component. -
minInclusive
private final double minInclusiveThe field for theminInclusiverecord component. -
maxExclusive
private final double maxExclusiveThe field for themaxExclusiverecord component. -
whenInRange
The field for thewhenInRangerecord component. -
whenOutOfRange
The field for thewhenOutOfRangerecord component. -
DATA_CODEC
-
CODEC
-
-
Constructor Details
-
RangeChoice
RangeChoice(DensityFunction input, double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Creates an instance of aRangeChoicerecord 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
-
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 '=='. -
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
minInclusive
public double minInclusive()Returns the value of theminInclusiverecord component.- Returns:
- the value of the
minInclusiverecord component
-
maxExclusive
public double 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
-