public class LargeOakTrunkPlacer extends TrunkPlacer
Modifier and Type | Class and Description |
---|---|
(package private) static class |
LargeOakTrunkPlacer.BranchPosition |
Modifier and Type | Field and Description |
---|---|
static com.mojang.serialization.Codec<LargeOakTrunkPlacer> |
CODEC |
baseHeight, firstRandomHeight, secondRandomHeight
Constructor and Description |
---|
LargeOakTrunkPlacer(int baseHeight,
int firstRandomHeight,
int secondRandomHeight) |
Modifier and Type | Method and 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 around
|
private Direction.Axis |
getLogAxis(BlockPos branchStart,
BlockPos branchEnd) |
private int |
getLongestSide(BlockPos offset) |
protected TrunkPlacerType<?> |
getType() |
private boolean |
isHighEnough(int treeHeight,
int height) |
private void |
makeBranches(ModifiableTestableWorld world,
Random random,
int treeHeight,
BlockPos treePos,
List<LargeOakTrunkPlacer.BranchPosition> branches,
Set<BlockPos> placedStates,
BlockBox box,
TreeFeatureConfig config) |
private boolean |
makeOrCheckBranch(ModifiableTestableWorld world,
Random random,
BlockPos start,
BlockPos end,
boolean make,
Set<BlockPos> placedStates,
BlockBox box,
TreeFeatureConfig config) |
private float |
shouldGenerateBranch(int trunkHeight,
int y)
If the returned value is greater than or equal to 0, a branch will be generated.
|
getAndSetState, getHeight, method_28904, setBlockState, setToDirt, trySetState
public static final com.mojang.serialization.Codec<LargeOakTrunkPlacer> CODEC
public LargeOakTrunkPlacer(int baseHeight, int firstRandomHeight, int secondRandomHeight)
protected TrunkPlacerType<?> getType()
getType
in class TrunkPlacer
public List<FoliagePlacer.TreeNode> generate(ModifiableTestableWorld world, Random random, int trunkHeight, BlockPos pos, Set<BlockPos> placedStates, BlockBox box, TreeFeatureConfig config)
generate
in class TrunkPlacer
private boolean makeOrCheckBranch(ModifiableTestableWorld world, Random random, BlockPos start, BlockPos end, boolean make, Set<BlockPos> placedStates, BlockBox box, TreeFeatureConfig config)
private int getLongestSide(BlockPos offset)
private Direction.Axis getLogAxis(BlockPos branchStart, BlockPos branchEnd)
private boolean isHighEnough(int treeHeight, int height)
private void makeBranches(ModifiableTestableWorld world, Random random, int treeHeight, BlockPos treePos, List<LargeOakTrunkPlacer.BranchPosition> branches, Set<BlockPos> placedStates, BlockBox box, TreeFeatureConfig config)
private float shouldGenerateBranch(int trunkHeight, int y)