Class NoiseCountModifier
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.placement.PlacementModifier
com.github.darksoulq.abyssallib.world.gen.placement.modifier.NoiseCountModifier
A placement modifier that duplicates the incoming position stream a variable number
of times based on a 2D simplex noise evaluation.
This allows features to generate in dense "patches" that organically fade into sparse patches across the terrain, rather than having a static count per chunk.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<NoiseCountModifier> The codec used for serializing and deserializing the noise count modifier.static final PlacementModifierType<NoiseCountModifier> The registered type definition for the noise count placement modifier. -
Constructor Summary
ConstructorsConstructorDescriptionNoiseCountModifier(double frequency, double threshold, int countAbove, int countBelow) Constructs a new NoiseCountModifier. -
Method Summary
Modifier and TypeMethodDescriptionStream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions) Evaluates the noise map at the provided coordinate and multiplies the position stream accordingly.getType()Retrieves the specific type definition for this modifier.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the noise count modifier. -
TYPE
The registered type definition for the noise count placement modifier.
-
-
Constructor Details
-
NoiseCountModifier
public NoiseCountModifier(double frequency, double threshold, int countAbove, int countBelow) Constructs a new NoiseCountModifier.- Parameters:
frequency- The frequency scale of the noise map.threshold- The breakpoint value of the noise evaluation.countAbove- The multiplier applied when noise exceeds the threshold.countBelow- The multiplier applied when noise is below or equal to the threshold.
-
-
Method Details
-
getPositions
public Stream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions) Evaluates the noise map at the provided coordinate and multiplies the position stream accordingly.- Specified by:
getPositionsin classPlacementModifier- Parameters:
context- The current placement context.positions- The incoming stream of potential placement vectors.- Returns:
- A stream of vectors duplicated by the calculated noise-dependent count.
-
getType
Retrieves the specific type definition for this modifier.- Specified by:
getTypein classPlacementModifier- Returns:
- The placement modifier type associated with this noise count modifier.
-