Class NoiseThresholdBlockStateProvider

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

public class NoiseThresholdBlockStateProvider extends BlockStateProvider
A block state provider that alternates between two block states based on 2D simplex noise.

This is used to create organic clusters, such as large patches of coarse dirt intertwined naturally with regular dirt or grass.

  • Field Details

  • Constructor Details

    • NoiseThresholdBlockStateProvider

      public NoiseThresholdBlockStateProvider(double scale, double threshold, BlockInfo normalState, BlockInfo highState)
      Constructs a new NoiseThresholdBlockStateProvider.
      Parameters:
      scale - The sampling frequency.
      threshold - The noise threshold boundary.
      normalState - The state below or at the threshold.
      highState - The state above the threshold.
  • Method Details

    • getState

      public BlockInfo getState(Random random, org.bukkit.Location location)
      Evaluates 2D simplex noise at the given location to determine the correct block state.
      Specified by:
      getState in class BlockStateProvider
      Parameters:
      random - The random source.
      location - The placement location.
      Returns:
      The selected block info based on the noise map.
    • getType

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