Class BiomeFilterModifier

java.lang.Object
com.github.darksoulq.abyssallib.world.gen.placement.PlacementModifier
com.github.darksoulq.abyssallib.world.gen.placement.modifier.BiomeFilterModifier

public class BiomeFilterModifier extends PlacementModifier
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 Details

  • Constructor Details

    • BiomeFilterModifier

      public BiomeFilterModifier(List<String> allowedBiomes)
      Constructs a new BiomeFilterModifier.
      Parameters:
      allowedBiomes - A list of valid namespaced biome keys.
  • 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:
      getPositions in class PlacementModifier
      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

      public PlacementModifierType<?> getType()
      Retrieves the specific type definition for this modifier.
      Specified by:
      getType in class PlacementModifier
      Returns:
      The placement modifier type associated with this biome filter modifier.