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
static record SurfaceRules.NoiseThresholdConditionSource(ResourceKey<NormalNoise.NoiseParameters> noise, double minThreshold, double maxThreshold)
extends Record
implements SurfaceRules.ConditionSource
-
Field Summary
Modifier and TypeFieldDescription(package private) static final KeyDispatchDataCodec<SurfaceRules.NoiseThresholdConditionSource>
private final double
The field for themaxThreshold
record component.private final double
The field for theminThreshold
record component.private final ResourceKey<NormalNoise.NoiseParameters>
The field for thenoise
record component. -
Constructor Summary
ConstructorDescriptionNoiseThresholdConditionSource
(ResourceKey<NormalNoise.NoiseParameters> noise, double minThreshold, double maxThreshold) Creates an instance of aNoiseThresholdConditionSource
record class. -
Method Summary
Modifier and TypeMethodDescriptionapply
(SurfaceRules.Context p_189640_) KeyDispatchDataCodec<? extends SurfaceRules.ConditionSource>
codec()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.double
Returns the value of themaxThreshold
record component.double
Returns the value of theminThreshold
record component.noise()
Returns the value of thenoise
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
noise
The field for thenoise
record component. -
minThreshold
private final double minThresholdThe field for theminThreshold
record component. -
maxThreshold
private final double maxThresholdThe field for themaxThreshold
record component. -
CODEC
-
-
Constructor Details
-
NoiseThresholdConditionSource
NoiseThresholdConditionSource(ResourceKey<NormalNoise.NoiseParameters> noise, double minThreshold, double maxThreshold) Creates an instance of aNoiseThresholdConditionSource
record class.- Parameters:
noise
- the value for thenoise
record componentminThreshold
- the value for theminThreshold
record componentmaxThreshold
- the value for themaxThreshold
record component
-
-
Method Details
-
codec
- Specified by:
codec
in interfaceSurfaceRules.ConditionSource
-
apply
- Specified by:
apply
in interfaceFunction<SurfaceRules.Context,
SurfaceRules.Condition>
-
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 '=='. -
noise
Returns the value of thenoise
record component.- Returns:
- the value of the
noise
record component
-
minThreshold
public double minThreshold()Returns the value of theminThreshold
record component.- Returns:
- the value of the
minThreshold
record component
-
maxThreshold
public double maxThreshold()Returns the value of themaxThreshold
record component.- Returns:
- the value of the
maxThreshold
record component
-