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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DensityFunctions.RangeChoice>
static final com.mojang.serialization.MapCodec<DensityFunctions.RangeChoice>
private final DensityFunction
The field for theinput
record component.private final double
The field for themaxExclusive
record component.private final double
The field for theminInclusive
record component.private final DensityFunction
The field for thewhenInRange
record component.private final DensityFunction
The field for thewhenOutOfRange
record component.Fields inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DIRECT_CODEC, HOLDER_HELPER_CODEC
-
Constructor Summary
ConstructorDescriptionRangeChoice
(DensityFunction input, double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Creates an instance of aRangeChoice
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<? extends DensityFunction>
codec()
double
compute
(DensityFunction.FunctionContext p_208839_) final boolean
Indicates whether some other object is "equal to" this one.void
fillArray
(double[] p_208843_, DensityFunction.ContextProvider p_208844_) final int
hashCode()
Returns a hash code value for this object.input()
Returns the value of theinput
record component.mapAll
(DensityFunction.Visitor p_208841_) double
Returns the value of themaxExclusive
record component.double
maxValue()
double
Returns the value of theminInclusive
record component.double
minValue()
final String
toString()
Returns a string representation of this record class.Returns the value of thewhenInRange
record component.Returns the value of thewhenOutOfRange
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.level.levelgen.DensityFunction
abs, clamp, cube, halfNegative, quarterNegative, square, squeeze
-
Field Details
-
input
The field for theinput
record component. -
minInclusive
private final double minInclusiveThe field for theminInclusive
record component. -
maxExclusive
private final double maxExclusiveThe field for themaxExclusive
record component. -
whenInRange
The field for thewhenInRange
record component. -
whenOutOfRange
The field for thewhenOutOfRange
record component. -
DATA_CODEC
-
CODEC
-
-
Constructor Details
-
RangeChoice
RangeChoice(DensityFunction input, double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Creates an instance of aRangeChoice
record class.- Parameters:
input
- the value for theinput
record componentminInclusive
- the value for theminInclusive
record componentmaxExclusive
- the value for themaxExclusive
record componentwhenInRange
- the value for thewhenInRange
record componentwhenOutOfRange
- the value for thewhenOutOfRange
record component
-
-
Method Details
-
compute
- Specified by:
compute
in interfaceDensityFunction
-
fillArray
- Specified by:
fillArray
in interfaceDensityFunction
-
mapAll
- Specified by:
mapAll
in interfaceDensityFunction
-
minValue
public double minValue()- Specified by:
minValue
in interfaceDensityFunction
-
maxValue
public double maxValue()- Specified by:
maxValue
in interfaceDensityFunction
-
codec
- Specified by:
codec
in 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 theinput
record component.- Returns:
- the value of the
input
record component
-
minInclusive
public double minInclusive()Returns the value of theminInclusive
record component.- Returns:
- the value of the
minInclusive
record component
-
maxExclusive
public double maxExclusive()Returns the value of themaxExclusive
record component.- Returns:
- the value of the
maxExclusive
record component
-
whenInRange
Returns the value of thewhenInRange
record component.- Returns:
- the value of the
whenInRange
record component
-
whenOutOfRange
Returns the value of thewhenOutOfRange
record component.- Returns:
- the value of the
whenOutOfRange
record component
-