Record Class DensityFunctions.Clamp
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.DensityFunctions.Clamp
- All Implemented Interfaces:
DensityFunction,DensityFunctions.PureTransformer
- Enclosing class:
- DensityFunctions
protected static record DensityFunctions.Clamp(DensityFunction input, double minValue, double maxValue)
extends Record
implements DensityFunctions.PureTransformer
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DensityFunction.ContextProvider, DensityFunction.FunctionContext, DensityFunction.NoiseHolder, DensityFunction.SimpleFunction, DensityFunction.SinglePointContext, DensityFunction.Visitor -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final KeyDispatchDataCodec<DensityFunctions.Clamp>private static final com.mojang.serialization.MapCodec<DensityFunctions.Clamp>private final DensityFunctionThe field for theinputrecord component.private final doubleThe field for themaxValuerecord component.private final doubleThe field for theminValuerecord component.Fields inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DIRECT_CODEC, HOLDER_HELPER_CODEC -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClamp(DensityFunction input, double minValue, double maxValue) Creates an instance of aClamprecord class. -
Method Summary
Modifier and TypeMethodDescriptionKeyDispatchDataCodec<? extends DensityFunction>codec()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 p_208599_) 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 p_208595_) 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, squeezeMethods inherited from interface net.minecraft.world.level.levelgen.DensityFunctions.PureTransformer
compute, fillArray
-
Field Details
-
input
The field for theinputrecord component. -
minValue
private final double minValueThe field for theminValuerecord component. -
maxValue
private final double maxValueThe field for themaxValuerecord component. -
DATA_CODEC
-
CODEC
-
-
Constructor Details
-
Clamp
Creates an instance of aClamprecord class.- Parameters:
input- the value for theinputrecord componentminValue- the value for theminValuerecord componentmaxValue- the value for themaxValuerecord component
-
-
Method Details
-
transform
public double transform(double p_208595_) - Specified by:
transformin interfaceDensityFunctions.PureTransformer
-
mapAll
- Specified by:
mapAllin interfaceDensityFunction
-
codec
- Specified by:
codecin interfaceDensityFunction
-
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
-
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 '=='.
-