Class StraightTrunkPlacer

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

public class StraightTrunkPlacer extends TrunkPlacer
A standard trunk placer that generates a straight vertical column of blocks.

This is used for basic trees like Oak, Birch, or Spruce. It returns a single foliage attachment point located at the very top of the generated trunk.

  • Field Details

    • CODEC

      public static final Codec<StraightTrunkPlacer> CODEC
      The codec used for serializing and deserializing the straight trunk placer. This placer has no configurable variables, so it encodes to an empty map.
    • TYPE

      public static final TrunkPlacerType<StraightTrunkPlacer> TYPE
      The registered type definition for the straight trunk placer.
  • Constructor Details

    • StraightTrunkPlacer

      public StraightTrunkPlacer()
      Constructs a new StraightTrunkPlacer.
  • Method Details

    • placeTrunk

      public List<org.bukkit.util.Vector> placeTrunk(WorldGenAccess level, Random random, org.bukkit.Location origin, BlockStateProvider trunkProvider, int height)
      Places a vertical column of blocks up to the specified height.
      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 containing the single attachment vector at the top of the trunk.
    • 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.