Class NoiseThresholdBlockStateProvider
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.state.provider.BlockStateProvider
com.github.darksoulq.abyssallib.world.gen.state.provider.impl.NoiseThresholdBlockStateProvider
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<NoiseThresholdBlockStateProvider> The codec used for serializing and deserializing the noise threshold provider.static final BlockStateProviderType<NoiseThresholdBlockStateProvider> The registered type definition for the noise threshold block state provider. -
Constructor Summary
ConstructorsConstructorDescriptionNoiseThresholdBlockStateProvider(double scale, double threshold, BlockInfo normalState, BlockInfo highState) Constructs a new NoiseThresholdBlockStateProvider. -
Method Summary
Modifier and TypeMethodDescriptionEvaluates 2D simplex noise at the given location to determine the correct block state.getType()Retrieves the specific type definition for this provider.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the noise threshold provider. -
TYPE
The registered type definition for the noise threshold block state provider.
-
-
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
Evaluates 2D simplex noise at the given location to determine the correct block state.- Specified by:
getStatein classBlockStateProvider- Parameters:
random- The random source.location- The placement location.- Returns:
- The selected block info based on the noise map.
-
getType
Retrieves the specific type definition for this provider.- Specified by:
getTypein classBlockStateProvider- Returns:
- The block state provider type.
-