Class NoiseCountModifier

java.lang.Object
com.github.darksoulq.abyssallib.world.gen.placement.PlacementModifier
com.github.darksoulq.abyssallib.world.gen.placement.modifier.NoiseCountModifier

public class NoiseCountModifier extends PlacementModifier
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 Details

  • 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:
      getPositions in class PlacementModifier
      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

      public PlacementModifierType<?> getType()
      Retrieves the specific type definition for this modifier.
      Specified by:
      getType in class PlacementModifier
      Returns:
      The placement modifier type associated with this noise count modifier.