public class AcaciaFoliagePlacer extends FoliagePlacer
offset, radius, randomOffset, randomRadius, type
Constructor and Description |
---|
AcaciaFoliagePlacer(com.mojang.datafixers.Dynamic<T> data) |
AcaciaFoliagePlacer(int radius,
int randomRadius,
int offset,
int randomOffset) |
Modifier and Type | Method and Description |
---|---|
void |
generate(ModifiableTestableWorld world,
Random random,
BranchedTreeFeatureConfig config,
int trunkHeight,
BlockPos pos,
int foliageHeight,
int radius,
Set<BlockPos> leaves)
This is the main method used to generate foliage.
|
int |
getHeight(Random random,
int trunkHeight) |
int |
getRadius(Random random,
int baseHeight,
BranchedTreeFeatureConfig config) |
int |
getRadiusForPlacement(int trunkHeight,
int baseHeight,
int radius)
This method is used to ensure that a tree can place foliage when it generates.
|
protected boolean |
isInvalidForLeaves(Random random,
int baseHeight,
int dx,
int dy,
int dz,
int radius) |
generate, placeLeaves, serialize
public AcaciaFoliagePlacer(int radius, int randomRadius, int offset, int randomOffset)
public AcaciaFoliagePlacer(com.mojang.datafixers.Dynamic<T> data)
public void generate(ModifiableTestableWorld world, Random random, BranchedTreeFeatureConfig config, int trunkHeight, BlockPos pos, int foliageHeight, int radius, Set<BlockPos> leaves)
generate
in class FoliagePlacer
public int getRadius(Random random, int baseHeight, BranchedTreeFeatureConfig config)
getRadius
in class FoliagePlacer
public int getHeight(Random random, int trunkHeight)
getHeight
in class FoliagePlacer
protected boolean isInvalidForLeaves(Random random, int baseHeight, int dx, int dy, int dz, int radius)
isInvalidForLeaves
in class FoliagePlacer
public int getRadiusForPlacement(int trunkHeight, int baseHeight, int radius)
It runs for every y-level of the tree being generated.
getRadiusForPlacement
in class FoliagePlacer
trunkHeight
- the height of the trunkbaseHeight
- the height of the full treeradius
- the radius of the foliage