public abstract class FoliagePlacer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
FoliagePlacer.TreeNode
A point on a tree to generate foliage around
|
Modifier and Type | Field and Description |
---|---|
protected UniformIntDistribution |
offset |
protected UniformIntDistribution |
radius |
static com.mojang.serialization.Codec<FoliagePlacer> |
TYPE_CODEC |
Constructor and Description |
---|
FoliagePlacer(UniformIntDistribution radius,
UniformIntDistribution offset) |
Modifier and Type | Method and Description |
---|---|
protected static <P extends FoliagePlacer> |
fillFoliagePlacerFields(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<P> instance) |
protected void |
generate(ModifiableTestableWorld world,
Random random,
TreeFeatureConfig config,
BlockPos pos,
int baseHeight,
Set<BlockPos> leaves,
int offset,
boolean giantTrunk,
BlockBox box) |
void |
generate(ModifiableTestableWorld world,
Random random,
TreeFeatureConfig config,
int trunkHeight,
FoliagePlacer.TreeNode treeNode,
int foliageHeight,
int radius,
Set<BlockPos> leaves,
BlockBox box) |
protected abstract 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.
|
abstract int |
getRandomHeight(Random random,
int trunkHeight,
TreeFeatureConfig config) |
private int |
getRandomOffset(Random random) |
int |
getRandomRadius(Random random,
int baseHeight) |
protected abstract FoliagePlacerType<?> |
getType() |
protected abstract boolean |
isInvalidForLeaves(Random random,
int baseHeight,
int dx,
int dy,
int dz,
boolean giantTrunk) |
protected boolean |
method_27387(Random random,
int int2,
int int3,
int int4,
int int5,
boolean bool) |
public static final com.mojang.serialization.Codec<FoliagePlacer> TYPE_CODEC
protected final UniformIntDistribution radius
protected final UniformIntDistribution offset
public FoliagePlacer(UniformIntDistribution radius, UniformIntDistribution offset)
protected static <P extends FoliagePlacer> com.mojang.datafixers.Products.P2<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<P>,UniformIntDistribution,UniformIntDistribution> fillFoliagePlacerFields(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<P> instance)
protected abstract FoliagePlacerType<?> getType()
public void generate(ModifiableTestableWorld world, Random random, TreeFeatureConfig config, int trunkHeight, FoliagePlacer.TreeNode treeNode, int foliageHeight, int radius, Set<BlockPos> leaves, BlockBox box)
protected abstract void generate(ModifiableTestableWorld world, Random random, TreeFeatureConfig config, int trunkHeight, FoliagePlacer.TreeNode treeNode, int foliageHeight, int radius, Set<BlockPos> leaves, int offset, BlockBox box)
public abstract int getRandomHeight(Random random, int trunkHeight, TreeFeatureConfig config)
public int getRandomRadius(Random random, int baseHeight)
private int getRandomOffset(Random random)
protected abstract boolean isInvalidForLeaves(Random random, int baseHeight, int dx, int dy, int dz, boolean giantTrunk)
protected boolean method_27387(Random random, int int2, int int3, int int4, int int5, boolean bool)
protected void generate(ModifiableTestableWorld world, Random random, TreeFeatureConfig config, BlockPos pos, int baseHeight, Set<BlockPos> leaves, int offset, boolean giantTrunk, BlockBox box)