public class DarkOakFoliagePlacer extends FoliagePlacer
FoliagePlacer.TreeNode| Modifier and Type | Field and Description |
|---|---|
static com.mojang.serialization.Codec<DarkOakFoliagePlacer> |
CODEC |
offset, radius, TYPE_CODEC| Constructor and Description |
|---|
DarkOakFoliagePlacer(UniformIntDistribution radius,
UniformIntDistribution offset) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
generate(ModifiableTestableWorld world,
Random random,
TreeFeatureConfig config,
int trunkHeight,
FoliagePlacer.TreeNode treeNode,
int foliageHeight,
int radius,
Set<BlockPos> leaves,
int offset,
BlockBox box)
This is the main method used to generate foliage.
|
int |
getRandomHeight(Random random,
int trunkHeight,
TreeFeatureConfig config) |
protected FoliagePlacerType<?> |
getType() |
protected boolean |
isInvalidForLeaves(Random random,
int baseHeight,
int dx,
int y,
int dz,
boolean giantTrunk)
Used to exclude certain positions such as corners when creating a square of leaves.
|
protected boolean |
isPositionInvalid(Random random,
int dx,
int y,
int dz,
int radius,
boolean giantTrunk)
Normalizes x and z coords before checking if they are invalid.
|
fillFoliagePlacerFields, generate, generateSquare, getRandomRadiuspublic static final com.mojang.serialization.Codec<DarkOakFoliagePlacer> CODEC
public DarkOakFoliagePlacer(UniformIntDistribution radius, UniformIntDistribution offset)
protected FoliagePlacerType<?> getType()
getType in class FoliagePlacerprotected void generate(ModifiableTestableWorld world, Random random, TreeFeatureConfig config, int trunkHeight, FoliagePlacer.TreeNode treeNode, int foliageHeight, int radius, Set<BlockPos> leaves, int offset, BlockBox box)
generate in class FoliagePlacerpublic int getRandomHeight(Random random, int trunkHeight, TreeFeatureConfig config)
getRandomHeight in class FoliagePlacerprotected boolean isPositionInvalid(Random random, int dx, int y, int dz, int radius, boolean giantTrunk)
isPositionInvalid in class FoliagePlacerprotected boolean isInvalidForLeaves(Random random, int baseHeight, int dx, int y, int dz, boolean giantTrunk)
isInvalidForLeaves in class FoliagePlacer