Class Feature<C extends FeatureConfig>

java.lang.Object
com.github.darksoulq.abyssallib.world.gen.feature.Feature<C>
Type Parameters:
C - The type of FeatureConfig utilized 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

public abstract class Feature<C extends FeatureConfig> extends Object
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
    Constructor
    Description
    Feature(Codec<C> codec)
    Constructs a new Feature with a specific configuration codec.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the codec instance responsible for handling this feature's configuration data.
    getPhase(C config)
    Declares the specific chronological step this feature should generate in.
    abstract boolean
    Executes the procedural generation logic to place blocks in the world.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Feature

      public Feature(Codec<C> codec)
      Constructs a new Feature with a specific configuration codec.
      Parameters:
      codec - The Codec used for the associated configuration type C.
  • Method Details

    • place

      public abstract boolean place(FeaturePlaceContext<C> context)
      Executes the procedural generation logic to place blocks in the world.
      Parameters:
      context - The FeaturePlaceContext containing 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

      public GenerationPhase getPhase(C config)
      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

      public Codec<C> getCodec()
      Retrieves the codec instance responsible for handling this feature's configuration data.
      Returns:
      The Codec instance for this feature's configuration.