Package net.minecraft.world.gen.foliage
Class MegaPineFoliagePlacer
java.lang.Object
net.minecraft.world.gen.foliage.FoliagePlacer
net.minecraft.world.gen.foliage.MegaPineFoliagePlacer
public class MegaPineFoliagePlacer extends FoliagePlacer
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.gen.foliage.FoliagePlacer
FoliagePlacer.TreeNode -
Field Summary
Fields Modifier and Type Field Description static com.mojang.serialization.Codec<MegaPineFoliagePlacer>CODECprivate UniformIntDistributioncrownHeightFields inherited from class net.minecraft.world.gen.foliage.FoliagePlacer
offset, radius, TYPE_CODEC -
Constructor Summary
Constructors Constructor Description MegaPineFoliagePlacer(UniformIntDistribution radius, UniformIntDistribution offset, UniformIntDistribution crownHeight) -
Method Summary
Modifier and Type Method Description protected voidgenerate(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.intgetRandomHeight(Random random, int trunkHeight, TreeFeatureConfig config)protected FoliagePlacerType<?>getType()protected booleanisInvalidForLeaves(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.Methods inherited from class net.minecraft.world.gen.foliage.FoliagePlacer
fillFoliagePlacerFields, generate, generateSquare, getRandomRadius, isPositionInvalid
-
Field Details
-
CODEC
-
crownHeight
-
-
Constructor Details
-
MegaPineFoliagePlacer
public MegaPineFoliagePlacer(UniformIntDistribution radius, UniformIntDistribution offset, UniformIntDistribution crownHeight)
-
-
Method Details
-
getType
- Specified by:
getTypein classFoliagePlacer
-
generate
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.- Specified by:
generatein classFoliagePlacer
-
getRandomHeight
- Specified by:
getRandomHeightin classFoliagePlacer
-
isInvalidForLeaves
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.- Specified by:
isInvalidForLeavesin classFoliagePlacer
-