Record Class DensityFunctions.Shift
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.DensityFunctions.Shift
- All Implemented Interfaces:
DensityFunction
,DensityFunction.SimpleFunction
,DensityFunctions.ShiftNoise
- Enclosing class:
- DensityFunctions
static record DensityFunctions.Shift(Holder<NormalNoise.NoiseParameters> noiseData, @Nullable NormalNoise offsetNoise)
extends Record
implements DensityFunctions.ShiftNoise
-
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 TypeFieldDescription(package private) static final com.mojang.serialization.Codec<DensityFunctions.Shift>
private final Holder<NormalNoise.NoiseParameters>
The field for thenoiseData
record component.private final NormalNoise
The field for theoffsetNoise
record component.Fields inherited from interface net.minecraft.world.level.levelgen.DensityFunction
DIRECT_CODEC, HOLDER_HELPER_CODEC
-
Constructor Summary
ConstructorDescriptionShift
(Holder<NormalNoise.NoiseParameters> noiseData, NormalNoise offsetNoise) Creates an instance of aShift
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<? extends DensityFunction>
codec()
double
compute
(DensityFunction.FunctionContext p_208864_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thenoiseData
record component.Returns the value of theoffsetNoise
record component.final String
toString()
Returns a string representation of this record class.withNewNoise
(NormalNoise p_208866_) 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
Methods inherited from interface net.minecraft.world.level.levelgen.DensityFunction.SimpleFunction
fillArray, mapAll
Methods inherited from interface net.minecraft.world.level.levelgen.DensityFunctions.ShiftNoise
compute, maxValue, minValue
-
Field Details
-
noiseData
The field for thenoiseData
record component. -
offsetNoise
The field for theoffsetNoise
record component. -
CODEC
-
-
Constructor Details
-
Shift
Shift(Holder<NormalNoise.NoiseParameters> noiseData, @Nullable NormalNoise offsetNoise) Creates an instance of aShift
record class.- Parameters:
noiseData
- the value for thenoiseData
record componentoffsetNoise
- the value for theoffsetNoise
record component
-
-
Method Details
-
compute
- Specified by:
compute
in interfaceDensityFunction
-
withNewNoise
- Specified by:
withNewNoise
in interfaceDensityFunctions.ShiftNoise
-
codec
- Specified by:
codec
in interfaceDensityFunction
-
noiseData
Returns the value of thenoiseData
record component.- Specified by:
noiseData
in interfaceDensityFunctions.ShiftNoise
- Returns:
- the value of the
noiseData
record component
-
offsetNoise
Returns the value of theoffsetNoise
record component.- Specified by:
offsetNoise
in interfaceDensityFunctions.ShiftNoise
- Returns:
- the value of the
offsetNoise
record 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. All components in this record class are compared withObjects::equals(Object,Object)
.
-