Class BiomeTransitionModifier

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

public class BiomeTransitionModifier extends PlacementModifier
A placement modifier that prevents feature bleeding across chunk boundaries.

Features are often scattered outwards from the center of a chunk. If a feature scatters far enough, it may land in a neighboring chunk that has a completely different biome. This filter ensures that the exact target block's biome strictly matches the biome at the center of the generating chunk.

  • Field Details

    • CODEC

      public static final Codec<BiomeTransitionModifier> CODEC
      The codec used for serializing and deserializing the biome transition modifier. Since this modifier has no configurable parameters, it encodes to an empty object.
    • TYPE

      The registered type definition for the biome transition placement modifier.
  • Constructor Details

    • BiomeTransitionModifier

      public BiomeTransitionModifier()
      Constructs a new BiomeTransitionModifier.
  • Method Details

    • getPositions

      public Stream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions)
      Filters the incoming positions by ensuring their exact biome matches the biome recorded at the geometric center of the active generation chunk.
      Specified by:
      getPositions in class PlacementModifier
      Parameters:
      context - The current placement context.
      positions - The incoming stream of potential placement vectors.
      Returns:
      A filtered stream of vectors residing within the correct biome.
    • 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 transition modifier.