Class FoliagePlacer

java.lang.Object
com.github.darksoulq.abyssallib.world.gen.feature.tree.foliage.FoliagePlacer
Direct Known Subclasses:
AcaciaFoliagePlacer, BlobFoliagePlacer, DarkOakFoliagePlacer, PineFoliagePlacer, RandomSpreadFoliagePlacer

public abstract class FoliagePlacer extends Object
The base class for all tree foliage generation algorithms.

A FoliagePlacer is responsible for building the leaf canopy around specific attachment points generated by the associated TrunkPlacer.

  • Field Details

    • CODEC

      public static final Codec<FoliagePlacer> CODEC
      Polymorphic codec for serializing and deserializing any foliage placer implementation.
  • Constructor Details

    • FoliagePlacer

      public FoliagePlacer()
  • Method Details

    • placeFoliage

      public abstract void placeFoliage(WorldGenAccess level, Random random, org.bukkit.Location attachmentPoint, BlockStateProvider foliageProvider, int radius)
      Executes the foliage generation logic around a specific point.
      Parameters:
      level - The world generation accessor.
      random - The deterministic random source.
      attachmentPoint - The central location to build the canopy around.
      foliageProvider - The block state provider for the leaf material.
      radius - The calculated horizontal radius for this specific foliage layer.
    • getType

      public abstract FoliagePlacerType<?> getType()
      Retrieves the specific type definition for this foliage placer.
      Returns:
      The foliage placer type associated with this instance.