Class ForkingTrunkPlacer

java.lang.Object
com.github.darksoulq.abyssallib.world.gen.feature.tree.trunk.TrunkPlacer
com.github.darksoulq.abyssallib.world.gen.feature.tree.trunk.ForkingTrunkPlacer

public class ForkingTrunkPlacer extends TrunkPlacer
A trunk placer that generates a main vertical stem and sprouts diagonal branches from its upper section.

This placer is highly useful for generating sprawling trees such as Acacia or large custom oaks. It calculates a main trunk and then casts out secondary branches, returning attachment points for the tips of every branch generated.

  • Field Details

  • Constructor Details

    • ForkingTrunkPlacer

      public ForkingTrunkPlacer(int branchCount, int branchLength)
      Constructs a new ForkingTrunkPlacer.
      Parameters:
      branchCount - The number of secondary branches to generate.
      branchLength - The length of the secondary branches.
  • Method Details

    • placeTrunk

      public List<org.bukkit.util.Vector> placeTrunk(WorldGenAccess level, Random random, org.bukkit.Location origin, BlockStateProvider trunkProvider, int height)
      Places the main vertical trunk and spawns diagonal branches outward.
      Specified by:
      placeTrunk in class TrunkPlacer
      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 tops of the main trunk and all branches.
    • getType

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