Class TrunkPlacer
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.feature.tree.trunk.TrunkPlacer
- Direct Known Subclasses:
BendingTrunkPlacer, ForkingTrunkPlacer, GiantTrunkPlacer, StraightTrunkPlacer, UpwardBranchingTrunkPlacer
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<TrunkPlacer> Polymorphic codec for serializing and deserializing any trunk placer implementation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract TrunkPlacerType<?> getType()Retrieves the specific type definition for this trunk placer.abstract List<org.bukkit.util.Vector> placeTrunk(WorldGenAccess level, Random random, org.bukkit.Location origin, BlockStateProvider trunkProvider, int height) Executes the trunk generation logic.
-
Field Details
-
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
Retrieves the specific type definition for this trunk placer.- Returns:
- The trunk placer type associated with this instance.
-