Class UpwardsBranchingTrunkPlacer
java.lang.Object
net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacer
net.minecraft.world.level.levelgen.feature.trunkplacers.UpwardsBranchingTrunkPlacer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<UpwardsBranchingTrunkPlacer> private final IntProviderprivate final IntProviderprivate final floatFields inherited from class TrunkPlacer
baseHeight, heightRandA, heightRandB, MAX_HEIGHT -
Constructor Summary
ConstructorsConstructorDescriptionUpwardsBranchingTrunkPlacer(int baseHeight, int heightRandA, int heightRandB, IntProvider extraBranchSteps, float placeBranchPerLogProbability, IntProvider extraBranchLength, HolderSet<Block> canGrowThrough) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidplaceBranch(WorldGenLevel level, BiConsumer<BlockPos, BlockState> trunkSetter, RandomSource random, int treeHeight, TreeConfiguration config, List<FoliagePlacer.FoliageAttachment> attachments, BlockPos.MutableBlockPos logPos, int currentHeight, Direction branchDir, int branchPos, int branchSteps) placeTrunk(WorldGenLevel level, BiConsumer<BlockPos, BlockState> trunkSetter, RandomSource random, int treeHeight, BlockPos origin, TreeConfiguration config) protected TrunkPlacerType<?> type()protected booleanvalidTreePos(WorldGenLevel level, BlockPos pos) Methods inherited from class TrunkPlacer
getTreeHeight, isFree, placeBelowTrunkBlock, placeLog, placeLog, placeLogIfFree, trunkPlacerParts
-
Field Details
-
CODEC
-
extraBranchSteps
-
placeBranchPerLogProbability
private final float placeBranchPerLogProbability -
extraBranchLength
-
canGrowThrough
-
-
Constructor Details
-
UpwardsBranchingTrunkPlacer
public UpwardsBranchingTrunkPlacer(int baseHeight, int heightRandA, int heightRandB, IntProvider extraBranchSteps, float placeBranchPerLogProbability, IntProvider extraBranchLength, HolderSet<Block> canGrowThrough)
-
-
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
-
placeBranch
private void placeBranch(WorldGenLevel level, BiConsumer<BlockPos, BlockState> trunkSetter, RandomSource random, int treeHeight, TreeConfiguration config, List<FoliagePlacer.FoliageAttachment> attachments, BlockPos.MutableBlockPos logPos, int currentHeight, Direction branchDir, int branchPos, int branchSteps) -
validTreePos
- Overrides:
validTreePosin classTrunkPlacer
-