Class Feature<C extends FeatureConfig>
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.feature.Feature<C>
- Type Parameters:
C- The type ofFeatureConfigutilized by this feature implementation.
- Direct Known Subclasses:
BlockAttachedFeature,BlockPatchFeature,DiskFeature,DripstoneClusterFeature,FossilFeature,GeodeFeature,LakeFeature,MultifaceGrowthFeature,OreFeature,PillarFeature,RandomBooleanFeature,RandomFeature,SimpleBlockFeature,SimpleRandomFeature,SpringFeature,StructureFeature,TreeFeature,VegetationPatchFeature,WaterloggedVegetationFeature
The base class for all world generation features such as trees, ore veins, or lakes.
A Feature represents the raw procedural logic used to place blocks within the world.
It is designed to be stateless, relying entirely on a
FeatureConfig to
determine its specific behavior and parameters during the generation process.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCodec()Retrieves the codec instance responsible for handling this feature's configuration data.Declares the specific chronological step this feature should generate in.abstract booleanplace(FeaturePlaceContext<C> context) Executes the procedural generation logic to place blocks in the world.
-
Constructor Details
-
Feature
Constructs a new Feature with a specific configuration codec.- Parameters:
codec- TheCodecused for the associated configuration typeC.
-
-
Method Details
-
place
Executes the procedural generation logic to place blocks in the world.- Parameters:
context- TheFeaturePlaceContextcontaining world access, random source, origin location, and the specific configuration instance.- Returns:
- True if the feature was successfully generated at the location, false otherwise.
-
getPhase
Declares the specific chronological step this feature should generate in.Override this method in subclasses to assign them to the correct phase (e.g., Ores should return UNDERGROUND_ORES, Trees should return VEGETAL_DECORATION).
- Returns:
- The generation phase for this feature.
-
getCodec
Retrieves the codec instance responsible for handling this feature's configuration data.- Returns:
- The
Codecinstance for this feature's configuration.
-