Class FoliagePlacer
java.lang.Object
net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacer
- Direct Known Subclasses:
AcaciaFoliagePlacer, BlobFoliagePlacer, CherryFoliagePlacer, DarkOakFoliagePlacer, MegaJungleFoliagePlacer, MegaPineFoliagePlacer, PineFoliagePlacer, RandomSpreadFoliagePlacer, SpruceFoliagePlacer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<FoliagePlacer> protected final IntProviderprotected final IntProvider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateFoliage(LevelSimulatedReader level, FoliagePlacer.FoliageSetter foliageSetter, RandomSource random, TreeConfiguration config, int treeHeight, FoliagePlacer.FoliageAttachment foliageAttachment, int foliageHeight, int leafRadius) protected abstract voidcreateFoliage(LevelSimulatedReader level, FoliagePlacer.FoliageSetter foliageSetter, RandomSource random, TreeConfiguration config, int treeHeight, FoliagePlacer.FoliageAttachment foliageAttachment, int foliageHeight, int leafRadius, int offset) abstract intfoliageHeight(RandomSource random, int treeHeight, TreeConfiguration config) protected static <P extends FoliagePlacer>
com.mojang.datafixers.Products.P2<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<P>, IntProvider, IntProvider> foliagePlacerParts(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<P> instance) intfoliageRadius(RandomSource random, int trunkHeight) private intoffset(RandomSource random) protected voidplaceLeavesRow(LevelSimulatedReader level, FoliagePlacer.FoliageSetter foliageSetter, RandomSource random, TreeConfiguration config, BlockPos origin, int currentRadius, int y, boolean doubleTrunk) protected final voidplaceLeavesRowWithHangingLeavesBelow(LevelSimulatedReader level, FoliagePlacer.FoliageSetter foliageSetter, RandomSource random, TreeConfiguration config, BlockPos origin, int currentRadius, int y, boolean doubleTrunk, float hangingLeavesChance, float hangingLeavesExtensionChance) protected abstract booleanshouldSkipLocation(RandomSource random, int dx, int y, int dz, int currentRadius, boolean doubleTrunk) Skips certain positions based on the provided shape, such as rounding corners randomly.protected booleanshouldSkipLocationSigned(RandomSource random, int dx, int y, int dz, int currentRadius, boolean doubleTrunk) private static booleantryPlaceExtension(LevelSimulatedReader level, FoliagePlacer.FoliageSetter foliageSetter, RandomSource random, TreeConfiguration config, float chance, BlockPos logPos, BlockPos.MutableBlockPos pos) protected static booleantryPlaceLeaf(LevelSimulatedReader level, FoliagePlacer.FoliageSetter foliageSetter, RandomSource random, TreeConfiguration config, BlockPos pos) protected abstract FoliagePlacerType<?> type()
-
Field Details
-
CODEC
-
radius
-
offset
-
-
Constructor Details
-
FoliagePlacer
-
-
Method Details
-
foliagePlacerParts
protected static <P extends FoliagePlacer> com.mojang.datafixers.Products.P2<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<P>, IntProvider, IntProvider> foliagePlacerParts(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<P> instance) -
type
-
createFoliage
public void createFoliage(LevelSimulatedReader level, FoliagePlacer.FoliageSetter foliageSetter, RandomSource random, TreeConfiguration config, int treeHeight, FoliagePlacer.FoliageAttachment foliageAttachment, int foliageHeight, int leafRadius) -
createFoliage
protected abstract void createFoliage(LevelSimulatedReader level, FoliagePlacer.FoliageSetter foliageSetter, RandomSource random, TreeConfiguration config, int treeHeight, FoliagePlacer.FoliageAttachment foliageAttachment, int foliageHeight, int leafRadius, int offset) -
foliageHeight
-
foliageRadius
-
offset
-
shouldSkipLocation
protected abstract boolean shouldSkipLocation(RandomSource random, int dx, int y, int dz, int currentRadius, boolean doubleTrunk) Skips certain positions based on the provided shape, such as rounding corners randomly. The coordinates are passed in as absolute value, and should be within [0,range]. -
shouldSkipLocationSigned
protected boolean shouldSkipLocationSigned(RandomSource random, int dx, int y, int dz, int currentRadius, boolean doubleTrunk) -
placeLeavesRow
protected void placeLeavesRow(LevelSimulatedReader level, FoliagePlacer.FoliageSetter foliageSetter, RandomSource random, TreeConfiguration config, BlockPos origin, int currentRadius, int y, boolean doubleTrunk) -
placeLeavesRowWithHangingLeavesBelow
protected final void placeLeavesRowWithHangingLeavesBelow(LevelSimulatedReader level, FoliagePlacer.FoliageSetter foliageSetter, RandomSource random, TreeConfiguration config, BlockPos origin, int currentRadius, int y, boolean doubleTrunk, float hangingLeavesChance, float hangingLeavesExtensionChance) -
tryPlaceExtension
private static boolean tryPlaceExtension(LevelSimulatedReader level, FoliagePlacer.FoliageSetter foliageSetter, RandomSource random, TreeConfiguration config, float chance, BlockPos logPos, BlockPos.MutableBlockPos pos) -
tryPlaceLeaf
protected static boolean tryPlaceLeaf(LevelSimulatedReader level, FoliagePlacer.FoliageSetter foliageSetter, RandomSource random, TreeConfiguration config, BlockPos pos)
-