Class SurfaceRelativeThresholdModifier
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.placement.PlacementModifier
com.github.darksoulq.abyssallib.world.gen.placement.modifier.SurfaceRelativeThresholdModifier
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<SurfaceRelativeThresholdModifier> The codec used for serializing and deserializing the surface relative threshold modifier.static final PlacementModifierType<SurfaceRelativeThresholdModifier> The registered type definition for the surface relative threshold placement modifier. -
Constructor Summary
ConstructorsConstructorDescriptionSurfaceRelativeThresholdModifier(org.bukkit.HeightMap heightmap, int minInclusive, int maxInclusive) Constructs a new SurfaceRelativeThresholdModifier. -
Method Summary
Modifier and TypeMethodDescriptionStream<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.getType()Retrieves the specific type definition for this modifier.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the surface relative threshold modifier. -
TYPE
The registered type definition for the surface relative threshold placement modifier.
-
-
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:
getPositionsin classPlacementModifier- 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
Retrieves the specific type definition for this modifier.- Specified by:
getTypein classPlacementModifier- Returns:
- The placement modifier type associated with this surface relative threshold modifier.
-