Class TrunkPlacer

java.lang.Object
com.github.darksoulq.abyssallib.world.gen.feature.tree.trunk.TrunkPlacer
Direct Known Subclasses:
BendingTrunkPlacer, ForkingTrunkPlacer, GiantTrunkPlacer, StraightTrunkPlacer, UpwardBranchingTrunkPlacer

public abstract class TrunkPlacer extends Object
The base class for all tree trunk generation algorithms.

A TrunkPlacer is responsible for building the wooden core of a tree and returning a list of attachment points where foliage should subsequently be generated.

  • Field Details

    • CODEC

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

    • TrunkPlacer

      public TrunkPlacer()
  • Method Details

    • placeTrunk

      public abstract List<org.bukkit.util.Vector> placeTrunk(WorldGenAccess level, Random random, org.bukkit.Location origin, BlockStateProvider trunkProvider, int height)
      Executes the trunk generation logic.
      Parameters:
      level - The world generation accessor.
      random - The deterministic random source.
      origin - The base starting location of the tree.
      trunkProvider - The block state provider for the trunk material.
      height - The calculated total height for this specific tree instance.
      Returns:
      A list of vectors representing the locations where foliage should be attached.
    • getType

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