Package net.minecraft.world.gen.foliage
Class DarkOakFoliagePlacer
java.lang.Object
net.minecraft.world.gen.foliage.FoliagePlacer
net.minecraft.world.gen.foliage.DarkOakFoliagePlacer
public class DarkOakFoliagePlacer 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<DarkOakFoliagePlacer>
CODEC
Fields inherited from class net.minecraft.world.gen.foliage.FoliagePlacer
offset, radius, TYPE_CODEC
-
Constructor Summary
Constructors Constructor Description DarkOakFoliagePlacer(UniformIntDistribution radius, UniformIntDistribution offset)
-
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.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.Methods inherited from class net.minecraft.world.gen.foliage.FoliagePlacer
fillFoliagePlacerFields, generate, generateSquare, getRandomRadius
-
Field Details
-
CODEC
-
-
Constructor Details
-
DarkOakFoliagePlacer
-
-
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
-
isPositionInvalid
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.- Overrides:
isPositionInvalid
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
-