Package net.minecraft.world.gen.foliage
Class SpruceFoliagePlacer
java.lang.Object
net.minecraft.world.gen.foliage.FoliagePlacer
net.minecraft.world.gen.foliage.SpruceFoliagePlacer
public class SpruceFoliagePlacer 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<SpruceFoliagePlacer>
CODEC
private UniformIntDistribution
trunkHeight
Fields inherited from class net.minecraft.world.gen.foliage.FoliagePlacer
offset, radius, TYPE_CODEC
-
Constructor Summary
Constructors Constructor Description SpruceFoliagePlacer(UniformIntDistribution radius, UniformIntDistribution offset, UniformIntDistribution trunkHeight)
-
Method Summary
Modifier and Type Method 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.Methods inherited from class net.minecraft.world.gen.foliage.FoliagePlacer
fillFoliagePlacerFields, generate, generateSquare, getRandomRadius, isPositionInvalid
-
Field Details
-
CODEC
-
trunkHeight
-
-
Constructor Details
-
SpruceFoliagePlacer
public SpruceFoliagePlacer(UniformIntDistribution radius, UniformIntDistribution offset, UniformIntDistribution trunkHeight)
-
-
Method Details
-
getType
- Specified by:
getType
in 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:
generate
in classFoliagePlacer
-
getRandomHeight
- Specified by:
getRandomHeight
in 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:
isInvalidForLeaves
in classFoliagePlacer
-