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
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<ForkingTrunkPlacer> The codec used for serializing and deserializing the forking trunk placer.static final TrunkPlacerType<ForkingTrunkPlacer> The registered type definition for the forking trunk placer. -
Constructor Summary
ConstructorsConstructorDescriptionForkingTrunkPlacer(int branchCount, int branchLength) Constructs a new ForkingTrunkPlacer. -
Method Summary
Modifier and TypeMethodDescriptiongetType()Retrieves the specific type definition for this trunk placer.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.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the forking trunk placer. -
TYPE
The registered type definition for the forking trunk placer.
-
-
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:
placeTrunkin classTrunkPlacer- 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
Retrieves the specific type definition for this trunk placer.- Specified by:
getTypein classTrunkPlacer- Returns:
- The trunk placer type associated with this instance.
-