Class RandomSpreadFoliagePlacer
java.lang.Object
net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacer
net.minecraft.world.level.levelgen.feature.foliageplacers.RandomSpreadFoliagePlacer
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacer
FoliagePlacer.FoliageAttachment, FoliagePlacer.FoliageSetter -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<RandomSpreadFoliagePlacer> private final IntProviderprivate final intFields inherited from class net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacer
offset, radius -
Constructor Summary
ConstructorsConstructorDescriptionRandomSpreadFoliagePlacer(IntProvider radius, IntProvider offset, IntProvider foliageHeight, int leafPlacementAttempts) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateFoliage(LevelSimulatedReader level, FoliagePlacer.FoliageSetter blockSetter, RandomSource random, TreeConfiguration config, int maxFreeTreeHeight, FoliagePlacer.FoliageAttachment attachment, int foliageHeight, int foliageRadius, int offset) intfoliageHeight(RandomSource random, int height, TreeConfiguration config) protected booleanshouldSkipLocation(RandomSource random, int localX, int localY, int localZ, int range, boolean large) Skips certain positions based on the provided shape, such as rounding corners randomly.protected FoliagePlacerType<?> type()Methods inherited from class net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacer
createFoliage, foliagePlacerParts, foliageRadius, placeLeavesRow, placeLeavesRowWithHangingLeavesBelow, shouldSkipLocationSigned, tryPlaceLeaf
-
Field Details
-
CODEC
-
foliageHeight
-
leafPlacementAttempts
private final int leafPlacementAttempts
-
-
Constructor Details
-
RandomSpreadFoliagePlacer
public RandomSpreadFoliagePlacer(IntProvider radius, IntProvider offset, IntProvider foliageHeight, int leafPlacementAttempts)
-
-
Method Details
-
type
- Specified by:
typein classFoliagePlacer
-
createFoliage
protected void createFoliage(LevelSimulatedReader level, FoliagePlacer.FoliageSetter blockSetter, RandomSource random, TreeConfiguration config, int maxFreeTreeHeight, FoliagePlacer.FoliageAttachment attachment, int foliageHeight, int foliageRadius, int offset) - Specified by:
createFoliagein classFoliagePlacer
-
foliageHeight
- Specified by:
foliageHeightin classFoliagePlacer
-
shouldSkipLocation
protected boolean shouldSkipLocation(RandomSource random, int localX, int localY, int localZ, int range, boolean large) 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].- Specified by:
shouldSkipLocationin classFoliagePlacer
-