Package net.minecraft.world.gen.trunk
Class LargeOakTrunkPlacer
java.lang.Object
net.minecraft.world.gen.trunk.TrunkPlacer
net.minecraft.world.gen.trunk.LargeOakTrunkPlacer
public class LargeOakTrunkPlacer extends TrunkPlacer
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classLargeOakTrunkPlacer.BranchPosition -
Field Summary
Fields Modifier and Type Field Description static com.mojang.serialization.Codec<LargeOakTrunkPlacer>CODECFields inherited from class net.minecraft.world.gen.trunk.TrunkPlacer
baseHeight, firstRandomHeight, secondRandomHeight -
Constructor Summary
Constructors Constructor Description LargeOakTrunkPlacer(int baseHeight, int firstRandomHeight, int secondRandomHeight) -
Method Summary
Modifier and Type Method Description List<FoliagePlacer.TreeNode>generate(ModifiableTestableWorld world, Random random, int trunkHeight, BlockPos pos, Set<BlockPos> placedStates, BlockBox box, TreeFeatureConfig config)Generates the trunk blocks and return a list of tree nodes to place foliage aroundprivate Direction.AxisgetLogAxis(BlockPos branchStart, BlockPos branchEnd)private intgetLongestSide(BlockPos offset)protected TrunkPlacerType<?>getType()private booleanisHighEnough(int treeHeight, int height)private voidmakeBranches(ModifiableTestableWorld world, Random random, int treeHeight, BlockPos treePos, List<LargeOakTrunkPlacer.BranchPosition> branches, Set<BlockPos> placedStates, BlockBox box, TreeFeatureConfig config)private booleanmakeOrCheckBranch(ModifiableTestableWorld world, Random random, BlockPos start, BlockPos end, boolean make, Set<BlockPos> placedStates, BlockBox box, TreeFeatureConfig config)private floatshouldGenerateBranch(int trunkHeight, int y)If the returned value is greater than or equal to 0, a branch will be generated.Methods inherited from class net.minecraft.world.gen.trunk.TrunkPlacer
getAndSetState, getHeight, method_28904, setBlockState, setToDirt, trySetState
-
Field Details
-
CODEC
-
-
Constructor Details
-
LargeOakTrunkPlacer
public LargeOakTrunkPlacer(int baseHeight, int firstRandomHeight, int secondRandomHeight)
-
-
Method Details
-
getType
- Specified by:
getTypein classTrunkPlacer
-
generate
public List<FoliagePlacer.TreeNode> generate(ModifiableTestableWorld world, Random random, int trunkHeight, BlockPos pos, Set<BlockPos> placedStates, BlockBox box, TreeFeatureConfig config)Generates the trunk blocks and return a list of tree nodes to place foliage around- Specified by:
generatein classTrunkPlacer
-
makeOrCheckBranch
private boolean makeOrCheckBranch(ModifiableTestableWorld world, Random random, BlockPos start, BlockPos end, boolean make, Set<BlockPos> placedStates, BlockBox box, TreeFeatureConfig config) -
getLongestSide
-
getLogAxis
-
isHighEnough
private boolean isHighEnough(int treeHeight, int height) -
makeBranches
private void makeBranches(ModifiableTestableWorld world, Random random, int treeHeight, BlockPos treePos, List<LargeOakTrunkPlacer.BranchPosition> branches, Set<BlockPos> placedStates, BlockBox box, TreeFeatureConfig config) -
shouldGenerateBranch
private float shouldGenerateBranch(int trunkHeight, int y)If the returned value is greater than or equal to 0, a branch will be generated.
-