Class BiomeFilterModifier
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.placement.PlacementModifier
com.github.darksoulq.abyssallib.world.gen.placement.modifier.BiomeFilterModifier
A placement modifier that filters positions based on the active biome at the coordinates.
This is crucial for ensuring features like desert flora only spawn in deserts, or specific ore variants only spawn in badlands.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<BiomeFilterModifier> The codec used for serializing and deserializing the biome filter modifier.static final PlacementModifierType<BiomeFilterModifier> The registered type definition for the biome filter placement modifier. -
Constructor Summary
ConstructorsConstructorDescriptionBiomeFilterModifier(List<String> allowedBiomes) Constructs a new BiomeFilterModifier. -
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 the biome at the vector matches the allowed list.getType()Retrieves the specific type definition for this modifier.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the biome filter modifier. -
TYPE
The registered type definition for the biome filter placement modifier.
-
-
Constructor Details
-
BiomeFilterModifier
-
-
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 the biome at the vector matches the allowed list.- 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 located in the specified biomes.
-
getType
Retrieves the specific type definition for this modifier.- Specified by:
getTypein classPlacementModifier- Returns:
- The placement modifier type associated with this biome filter modifier.
-