Record Class NoiseBasedCountPlacement
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.placement.NoiseBasedCountPlacement
- All Implemented Interfaces:
PlacementModifier, RepeatingPlacement
public record NoiseBasedCountPlacement(int noiseToCountRatio, double noiseFactor, double noiseOffset)
extends Record
implements RepeatingPlacement
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<NoiseBasedCountPlacement> private final doubleThe field for thenoiseFactorrecord component.private final doubleThe field for thenoiseOffsetrecord component.private final intThe field for thenoiseToCountRatiorecord component. -
Constructor Summary
ConstructorsConstructorDescriptionNoiseBasedCountPlacement(int noiseToCountRatio, double noiseFactor, double noiseOffset) Creates an instance of aNoiseBasedCountPlacementrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<NoiseBasedCountPlacement> codec()intcount(RandomSource random, BlockPos origin) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thenoiseFactorrecord component.doubleReturns the value of thenoiseOffsetrecord component.intReturns the value of thenoiseToCountRatiorecord component.static NoiseBasedCountPlacementof(int noiseToCountRatio, double noiseFactor, double noiseOffset) final StringtoString()Returns a string representation of this record class.Methods inherited from interface RepeatingPlacement
modify
-
Field Details
-
noiseToCountRatio
private final int noiseToCountRatioThe field for thenoiseToCountRatiorecord component. -
noiseFactor
private final double noiseFactorThe field for thenoiseFactorrecord component. -
noiseOffset
private final double noiseOffsetThe field for thenoiseOffsetrecord component. -
CODEC
-
-
Constructor Details
-
NoiseBasedCountPlacement
public NoiseBasedCountPlacement(int noiseToCountRatio, double noiseFactor, double noiseOffset) Creates an instance of aNoiseBasedCountPlacementrecord class.- Parameters:
noiseToCountRatio- the value for thenoiseToCountRatiorecord componentnoiseFactor- the value for thenoiseFactorrecord componentnoiseOffset- the value for thenoiseOffsetrecord component
-
-
Method Details
-
of
public static NoiseBasedCountPlacement of(int noiseToCountRatio, double noiseFactor, double noiseOffset) -
count
- Specified by:
countin interfaceRepeatingPlacement
-
codec
- Specified by:
codecin interfacePlacementModifier- Specified by:
codecin interfaceRepeatingPlacement
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
noiseToCountRatio
public int noiseToCountRatio()Returns the value of thenoiseToCountRatiorecord component.- Returns:
- the value of the
noiseToCountRatiorecord component
-
noiseFactor
public double noiseFactor()Returns the value of thenoiseFactorrecord component.- Returns:
- the value of the
noiseFactorrecord component
-
noiseOffset
public double noiseOffset()Returns the value of thenoiseOffsetrecord component.- Returns:
- the value of the
noiseOffsetrecord component
-