Class NoiseThresholdModifier

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

public class NoiseThresholdModifier extends PlacementModifier
A placement modifier that filters positions based on 2D simplex noise.
  • Field Details

  • Constructor Details

    • NoiseThresholdModifier

      public NoiseThresholdModifier(double frequency, double threshold, boolean aboveThreshold)
      Constructs a new NoiseThresholdModifier.
      Parameters:
      frequency - The sampling frequency.
      threshold - The noise threshold.
      aboveThreshold - True if the noise must exceed the threshold, false if it must be below.
  • Method Details

    • getPositions

      public Stream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions)
      Filters the incoming positions by evaluating a 2D simplex noise value at the given coordinates.
      Specified by:
      getPositions in class PlacementModifier
      Parameters:
      context - The current placement context.
      positions - The incoming stream of potential placement vectors.
      Returns:
      A filtered stream containing only vectors that passed the noise check.
    • 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 threshold modifier.