Class WaterDepthFilterModifier
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.placement.PlacementModifier
com.github.darksoulq.abyssallib.world.gen.placement.modifier.WaterDepthFilterModifier
A placement modifier that filters positions based on the depth of the water column above them.
This modifier is strictly utilized for aquatic feature generation (such as seagrass, kelp, or coral), ensuring that the target placement block is submerged under a specific maximum depth of contiguous water.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<WaterDepthFilterModifier> The codec used for serializing and deserializing the water depth filter modifier.static final PlacementModifierType<WaterDepthFilterModifier> The registered type definition for the water depth filter placement modifier. -
Constructor Summary
ConstructorsConstructorDescriptionWaterDepthFilterModifier(int maxDepth) Constructs a new WaterDepthFilterModifier. -
Method Summary
Modifier and TypeMethodDescriptionStream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions) Filters the incoming positions by scanning the Y-axis upward to count contiguous water.getType()Retrieves the specific type definition for this modifier.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the water depth filter modifier. -
TYPE
The registered type definition for the water depth filter placement modifier.
-
-
Constructor Details
-
WaterDepthFilterModifier
public WaterDepthFilterModifier(int maxDepth) Constructs a new WaterDepthFilterModifier.- Parameters:
maxDepth- The maximum tolerable water depth.
-
-
Method Details
-
getPositions
public Stream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions) Filters the incoming positions by scanning the Y-axis upward to count contiguous water.- Specified by:
getPositionsin classPlacementModifier- Parameters:
context- The current placement context.positions- The incoming stream of potential placement vectors.- Returns:
- A filtered stream containing only vectors submerged within the allowed depth limits.
-
getType
Retrieves the specific type definition for this modifier.- Specified by:
getTypein classPlacementModifier- Returns:
- The placement modifier type associated with this water depth filter modifier.
-