Class RandomFeature
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.feature.Feature<RandomFeature.Config>
com.github.darksoulq.abyssallib.world.gen.feature.impl.RandomFeature
A meta-feature that evaluates a list of potential sub-features sequentially,
placing the first one that passes its individual probability check.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordConfiguration record for the random feature.static final recordA record defining a PlacedFeature paired with an execution probability. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new RandomFeature with its associated configuration codec. -
Method Summary
Modifier and TypeMethodDescriptiongetPhase(RandomFeature.Config config) Specifies the procedural generation phase in which this feature executes.booleanplace(FeaturePlaceContext<RandomFeature.Config> context) Executes the sequential probability checks and delegates placement to the selected feature.
-
Constructor Details
-
RandomFeature
public RandomFeature()Constructs a new RandomFeature with its associated configuration codec.
-
-
Method Details
-
place
Executes the sequential probability checks and delegates placement to the selected feature.- Specified by:
placein classFeature<RandomFeature.Config>- Parameters:
context- The feature place context providing world access and configuration.- Returns:
- True if the selected feature successfully placed blocks.
-
getPhase
Specifies the procedural generation phase in which this feature executes.- Overrides:
getPhasein classFeature<RandomFeature.Config>- Parameters:
config- The configuration containing the sub-features.- Returns:
- The dynamic generation phase of the underlying fallback feature.
-