Class HeightRangeModifier
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.placement.PlacementModifier
com.github.darksoulq.abyssallib.world.gen.placement.modifier.HeightRangeModifier
A placement modifier that randomizes the Y-coordinate of input positions
between a specified minimum and maximum bounds.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<HeightRangeModifier> The codec used for serializing and deserializing the height range modifier.static final PlacementModifierType<HeightRangeModifier> The registered type definition for the height range placement modifier. -
Constructor Summary
ConstructorsConstructorDescriptionHeightRangeModifier(int minInclusive, int maxInclusive) Constructs a new HeightRangeModifier. -
Method Summary
Modifier and TypeMethodDescriptionStream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions) Replaces the Y coordinate of each input position with a random integer between the configured minimum and maximum bounds.getType()Retrieves the placement modifier type used for identifying this specific implementation.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the height range modifier. -
TYPE
The registered type definition for the height range placement modifier.
-
-
Constructor Details
-
HeightRangeModifier
public HeightRangeModifier(int minInclusive, int maxInclusive) Constructs a new HeightRangeModifier.- Parameters:
minInclusive- The lowest Y level to place features.maxInclusive- The highest Y level to place features.
-
-
Method Details
-
getPositions
public Stream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions) Replaces the Y coordinate of each input position with a random integer between the configured minimum and maximum bounds.- Specified by:
getPositionsin classPlacementModifier- Parameters:
context- The current placement context.positions- The incoming stream of potential placement vectors.- Returns:
- A stream of vectors with randomized vertical positions.
-
getType
Description copied from class:PlacementModifierRetrieves the placement modifier type used for identifying this specific implementation.- Specified by:
getTypein classPlacementModifier- Returns:
- The placement modifier type associated with this instance.
-