Class WeightedBlockStateProvider

java.lang.Object
com.github.darksoulq.abyssallib.world.gen.state.provider.BlockStateProvider
com.github.darksoulq.abyssallib.world.gen.state.provider.impl.WeightedBlockStateProvider

public class WeightedBlockStateProvider extends BlockStateProvider
A block state provider that selects a block state from a pool based on relative weights.
  • Field Details

  • Constructor Details

    • WeightedBlockStateProvider

      public WeightedBlockStateProvider(List<WeightedBlockStateProvider.Entry> entries)
      Constructs a new WeightedBlockStateProvider.
      Parameters:
      entries - The list of weighted entries to select from.
  • Method Details

    • getState

      public BlockInfo getState(Random random, org.bukkit.Location location)
      Randomly selects a block state from the pool based on relative weight.
      Specified by:
      getState in class BlockStateProvider
      Parameters:
      random - The random source.
      location - The placement location.
      Returns:
      The selected block info, or null if the pool is empty.
    • getType

      public BlockStateProviderType<?> getType()
      Retrieves the specific type definition for this provider.
      Specified by:
      getType in class BlockStateProvider
      Returns:
      The block state provider type.