Class SurfaceRelativeThresholdModifier

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

public class SurfaceRelativeThresholdModifier extends PlacementModifier
A placement modifier that filters positions based on their vertical proximity to a selected world heightmap (surface).

If the incoming vector's Y-coordinate does not fall within the configured relative bounds, the vector is discarded.

  • Field Details

  • Constructor Details

    • SurfaceRelativeThresholdModifier

      public SurfaceRelativeThresholdModifier(org.bukkit.HeightMap heightmap, int minInclusive, int maxInclusive)
      Constructs a new SurfaceRelativeThresholdModifier.
      Parameters:
      heightmap - The target surface heightmap (e.g., OCEAN_FLOOR, WORLD_SURFACE).
      minInclusive - The lowest relative offset allowed.
      maxInclusive - The highest relative offset allowed.
  • Method Details

    • getPositions

      public Stream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions)
      Filters the incoming positions by checking if their absolute Y-coordinate falls within the allowed bounds relative to the surface Y-coordinate at their X/Z location.
      Specified by:
      getPositions in class PlacementModifier
      Parameters:
      context - The current placement context.
      positions - The incoming stream of potential placement vectors.
      Returns:
      A filtered stream of vectors that met the surface proximity condition.
    • 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 surface relative threshold modifier.