Class HeightmapModifier
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.placement.PlacementModifier
com.github.darksoulq.abyssallib.world.gen.placement.modifier.HeightmapModifier
A placement modifier that snaps the Y-coordinate of incoming positions to the
highest block at that specific X and Z coordinate, dictated by a selected heightmap.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<HeightmapModifier> The codec used for serializing and deserializing the heightmap modifier.static final PlacementModifierType<HeightmapModifier> The registered type definition for the heightmap placement modifier. -
Constructor Summary
ConstructorsConstructorDescriptionHeightmapModifier(org.bukkit.HeightMap heightmap) Constructs a new HeightmapModifier. -
Method Summary
Modifier and TypeMethodDescriptionStream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions) Projects the Y-coordinate of each incoming position to the surface defined by the heightmap.getType()Retrieves the specific type definition for this modifier.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the heightmap modifier. -
TYPE
The registered type definition for the heightmap placement modifier.
-
-
Constructor Details
-
HeightmapModifier
public HeightmapModifier(org.bukkit.HeightMap heightmap) Constructs a new HeightmapModifier.- Parameters:
heightmap- The Bukkit heightmap criteria to apply.
-
-
Method Details
-
getPositions
public Stream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions) Projects the Y-coordinate of each incoming position to the surface defined by the heightmap.- Specified by:
getPositionsin classPlacementModifier- Parameters:
context- The current placement context.positions- The incoming stream of potential placement vectors.- Returns:
- A stream of vectors mapped directly onto the heightmap surface.
-
getType
Retrieves the specific type definition for this modifier.- Specified by:
getTypein classPlacementModifier- Returns:
- The placement modifier type associated with this heightmap modifier.
-