Record Class SurfaceRules.NoiseThresholdConditionSource
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.SurfaceRules.NoiseThresholdConditionSource
- All Implemented Interfaces:
Function<SurfaceRules.Context, SurfaceRules.Condition>, SurfaceRules.ConditionSource
- Enclosing class:
SurfaceRules
private static record SurfaceRules.NoiseThresholdConditionSource(ResourceKey<NormalNoise.NoiseParameters> noise, double minThreshold, double maxThreshold, boolean is3d)
extends Record
implements SurfaceRules.ConditionSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.serialization.MapCodec<SurfaceRules.NoiseThresholdConditionSource> private final booleanThe field for theis3drecord component.private final doubleThe field for themaxThresholdrecord component.private final doubleThe field for theminThresholdrecord component.private final ResourceKey<NormalNoise.NoiseParameters> The field for thenoiserecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNoiseThresholdConditionSource(ResourceKey<NormalNoise.NoiseParameters> noise, double minThreshold, double maxThreshold, boolean is3d) Creates an instance of aNoiseThresholdConditionSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionapply(SurfaceRules.Context ruleContext) com.mojang.serialization.MapCodec<SurfaceRules.NoiseThresholdConditionSource> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanis3d()Returns the value of theis3drecord component.doubleReturns the value of themaxThresholdrecord component.doubleReturns the value of theminThresholdrecord component.noise()Returns the value of thenoiserecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
noise
The field for thenoiserecord component. -
minThreshold
private final double minThresholdThe field for theminThresholdrecord component. -
maxThreshold
private final double maxThresholdThe field for themaxThresholdrecord component. -
is3d
private final boolean is3dThe field for theis3drecord component. -
CODEC
private static final com.mojang.serialization.MapCodec<SurfaceRules.NoiseThresholdConditionSource> CODEC
-
-
Constructor Details
-
NoiseThresholdConditionSource
private NoiseThresholdConditionSource(ResourceKey<NormalNoise.NoiseParameters> noise, double minThreshold, double maxThreshold, boolean is3d) Creates an instance of aNoiseThresholdConditionSourcerecord class.- Parameters:
noise- the value for thenoiserecord componentminThreshold- the value for theminThresholdrecord componentmaxThreshold- the value for themaxThresholdrecord componentis3d- the value for theis3drecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceSurfaceRules.ConditionSource
-
apply
- Specified by:
applyin interfaceFunction<SurfaceRules.Context, SurfaceRules.Condition>
-
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. -
noise
Returns the value of thenoiserecord component.- Returns:
- the value of the
noiserecord component
-
minThreshold
public double minThreshold()Returns the value of theminThresholdrecord component.- Returns:
- the value of the
minThresholdrecord component
-
maxThreshold
public double maxThreshold()Returns the value of themaxThresholdrecord component.- Returns:
- the value of the
maxThresholdrecord component
-
is3d
public boolean is3d()Returns the value of theis3drecord component.- Returns:
- the value of the
is3drecord component
-