Class FancyTrunkPlacer
java.lang.Object
net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacer
net.minecraft.world.level.levelgen.feature.trunkplacers.FancyTrunkPlacer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final doubleprivate static final doubleprivate static final doublestatic final com.mojang.serialization.MapCodec<FancyTrunkPlacer> private static final doubleFields inherited from class TrunkPlacer
baseHeight, heightRandA, heightRandB, MAX_HEIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Direction.AxisgetLogAxis(BlockPos startPos, BlockPos blockPos) private intprivate voidmakeBranches(WorldGenLevel level, BiConsumer<BlockPos, BlockState> trunkSetter, RandomSource random, int height, BlockPos origin, List<FancyTrunkPlacer.FoliageCoords> foliageCoords, TreeConfiguration config) private booleanmakeLimb(WorldGenLevel level, BiConsumer<BlockPos, BlockState> trunkSetter, RandomSource random, BlockPos startPos, BlockPos endPos, boolean doPlace, TreeConfiguration config) placeTrunk(WorldGenLevel level, BiConsumer<BlockPos, BlockState> trunkSetter, RandomSource random, int treeHeight, BlockPos origin, TreeConfiguration config) private static floattreeShape(int height, int y) private booleantrimBranches(int height, int localY) protected TrunkPlacerType<?> type()Methods inherited from class TrunkPlacer
getTreeHeight, isFree, placeBelowTrunkBlock, placeLog, placeLog, placeLogIfFree, trunkPlacerParts, validTreePos
-
Field Details
-
CODEC
-
TRUNK_HEIGHT_SCALE
private static final double TRUNK_HEIGHT_SCALE- See Also:
-
CLUSTER_DENSITY_MAGIC
private static final double CLUSTER_DENSITY_MAGIC- See Also:
-
BRANCH_SLOPE
private static final double BRANCH_SLOPE- See Also:
-
BRANCH_LENGTH_MAGIC
private static final double BRANCH_LENGTH_MAGIC- See Also:
-
-
Constructor Details
-
FancyTrunkPlacer
public FancyTrunkPlacer(int baseHeight, int heightRandA, int heightRandB)
-
-
Method Details
-
type
- Specified by:
typein classTrunkPlacer
-
placeTrunk
public List<FoliagePlacer.FoliageAttachment> placeTrunk(WorldGenLevel level, BiConsumer<BlockPos, BlockState> trunkSetter, RandomSource random, int treeHeight, BlockPos origin, TreeConfiguration config) - Specified by:
placeTrunkin classTrunkPlacer
-
makeLimb
private boolean makeLimb(WorldGenLevel level, BiConsumer<BlockPos, BlockState> trunkSetter, RandomSource random, BlockPos startPos, BlockPos endPos, boolean doPlace, TreeConfiguration config) -
getSteps
-
getLogAxis
-
trimBranches
private boolean trimBranches(int height, int localY) -
makeBranches
private void makeBranches(WorldGenLevel level, BiConsumer<BlockPos, BlockState> trunkSetter, RandomSource random, int height, BlockPos origin, List<FancyTrunkPlacer.FoliageCoords> foliageCoords, TreeConfiguration config) -
treeShape
private static float treeShape(int height, int y)
-