Class InSquareModifier
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.placement.PlacementModifier
com.github.darksoulq.abyssallib.world.gen.placement.modifier.InSquareModifier
A placement modifier that spreads the input positions randomly across the X and Z axes
within the bounds of a standard 16x16 chunk.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<InSquareModifier> The codec used for serializing and deserializing the in-square modifier.static final PlacementModifierType<InSquareModifier> The registered type definition for the in-square placement modifier. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionStream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions) Applies a random horizontal offset to each incoming position.getType()Retrieves the placement modifier type used for identifying this specific implementation.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the in-square modifier. -
TYPE
The registered type definition for the in-square placement modifier.
-
-
Constructor Details
-
InSquareModifier
public InSquareModifier()Constructs a new InSquareModifier.
-
-
Method Details
-
getPositions
public Stream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions) Applies a random horizontal offset to each incoming position. The offset is between 0 and 15 blocks on both the X and Z axes.- Specified by:
getPositionsin classPlacementModifier- Parameters:
context- The current placement context.positions- The incoming stream of potential placement vectors.- Returns:
- A stream of vectors randomly offset horizontally.
-
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.
-