Record Class DensityFunctions.Mapped
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.DensityFunctions.Mapped
- All Implemented Interfaces:
DensityFunction, DensityFunctions.PureTransformer
- Enclosing class:
DensityFunctions
protected static record DensityFunctions.Mapped(DensityFunctions.Mapped.Type type, DensityFunction input, double minValue, double maxValue)
extends Record
implements DensityFunctions.PureTransformer
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface DensityFunction
DensityFunction.ContextProvider, DensityFunction.FunctionContext, DensityFunction.NoiseHolder, DensityFunction.SimpleFunction, DensityFunction.SinglePointContext, DensityFunction.Visitor -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DensityFunctionThe field for theinputrecord component.private final doubleThe field for themaxValuerecord component.private final doubleThe field for theminValuerecord component.private final DensityFunctions.Mapped.TypeThe field for thetyperecord component.Fields inherited from interface DensityFunction
CODEC, DIRECT_CODEC, HOLDER_HELPER_CODEC -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMapped(DensityFunctions.Mapped.Type type, DensityFunction input, double minValue, double maxValue) Creates an instance of aMappedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionKeyDispatchDataCodec<? extends DensityFunction> codec()static DensityFunctions.Mappedcreate(DensityFunctions.Mapped.Type type, DensityFunction 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.mapAll(DensityFunction.Visitor visitor) doublemaxValue()Returns the value of themaxValuerecord component.doubleminValue()Returns the value of theminValuerecord component.final StringtoString()Returns a string representation of this record class.doubletransform(double input) private static doubletransform(DensityFunctions.Mapped.Type type, double input) type()Returns the value of thetyperecord component.Methods inherited from interface DensityFunction
abs, clamp, cube, halfNegative, invert, quarterNegative, square, squeezeMethods inherited from interface DensityFunctions.PureTransformer
compute, fillArray
-
Field Details
-
type
The field for thetyperecord component. -
input
The field for theinputrecord component. -
minValue
private final double minValueThe field for theminValuerecord component. -
maxValue
private final double maxValueThe field for themaxValuerecord component.
-
-
Constructor Details
-
Mapped
protected Mapped(DensityFunctions.Mapped.Type type, DensityFunction input, double minValue, double maxValue) Creates an instance of aMappedrecord class.- Parameters:
type- the value for thetyperecord componentinput- the value for theinputrecord componentminValue- the value for theminValuerecord componentmaxValue- the value for themaxValuerecord component
-
-
Method Details
-
create
public static DensityFunctions.Mapped create(DensityFunctions.Mapped.Type type, DensityFunction input) -
transform
-
transform
public double transform(double input) - Specified by:
transformin interfaceDensityFunctions.PureTransformer
-
mapAll
- Specified by:
mapAllin 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. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
input
Returns the value of theinputrecord component.- Specified by:
inputin interfaceDensityFunctions.PureTransformer- Returns:
- the value of the
inputrecord component
-
minValue
public double minValue()Returns the value of theminValuerecord component.- Specified by:
minValuein interfaceDensityFunction- Returns:
- the value of the
minValuerecord component
-
maxValue
public double maxValue()Returns the value of themaxValuerecord component.- Specified by:
maxValuein interfaceDensityFunction- Returns:
- the value of the
maxValuerecord component
-