Class TrunkPlacer
java.lang.Object
net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacer
- Direct Known Subclasses:
BendingTrunkPlacer
,CherryTrunkPlacer
,DarkOakTrunkPlacer
,FancyTrunkPlacer
,ForkingTrunkPlacer
,GiantTrunkPlacer
,StraightTrunkPlacer
,UpwardsBranchingTrunkPlacer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final int
static final com.mojang.serialization.Codec
<TrunkPlacer> protected final int
protected final int
private static final int
static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getTreeHeight
(RandomSource random) private static boolean
isDirt
(LevelSimulatedReader level, BlockPos pos) boolean
isFree
(LevelSimulatedReader level, BlockPos pos) protected boolean
placeLog
(LevelSimulatedReader level, BiConsumer<BlockPos, BlockState> blockSetter, RandomSource random, BlockPos pos, TreeConfiguration config) protected boolean
placeLog
(LevelSimulatedReader level, BiConsumer<BlockPos, BlockState> blockSetter, RandomSource random, BlockPos pos, TreeConfiguration config, Function<BlockState, BlockState> propertySetter) protected void
placeLogIfFree
(LevelSimulatedReader level, BiConsumer<BlockPos, BlockState> blockSetter, RandomSource random, BlockPos.MutableBlockPos pos, TreeConfiguration config) abstract List
<FoliagePlacer.FoliageAttachment> placeTrunk
(LevelSimulatedReader level, BiConsumer<BlockPos, BlockState> blockSetter, RandomSource random, int freeTreeHeight, BlockPos pos, TreeConfiguration config) protected static void
setDirtAt
(LevelSimulatedReader level, BiConsumer<BlockPos, BlockState> blockSetter, RandomSource random, BlockPos pos, TreeConfiguration config) protected static <P extends TrunkPlacer>
com.mojang.datafixers.Products.P3<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<P>, Integer, Integer, Integer> trunkPlacerParts
(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<P> instance) protected abstract TrunkPlacerType
<?> type()
protected boolean
validTreePos
(LevelSimulatedReader level, BlockPos pos)
-
Field Details
-
CODEC
-
MAX_BASE_HEIGHT
private static final int MAX_BASE_HEIGHT- See Also:
-
MAX_RAND
private static final int MAX_RAND- See Also:
-
MAX_HEIGHT
public static final int MAX_HEIGHT- See Also:
-
baseHeight
protected final int baseHeight -
heightRandA
protected final int heightRandA -
heightRandB
protected final int heightRandB
-
-
Constructor Details
-
TrunkPlacer
public TrunkPlacer(int baseHeight, int heightRandA, int heightRandB)
-
-
Method Details
-
trunkPlacerParts
protected static <P extends TrunkPlacer> com.mojang.datafixers.Products.P3<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<P>,Integer, trunkPlacerPartsInteger, Integer> (com.mojang.serialization.codecs.RecordCodecBuilder.Instance<P> instance) -
type
-
placeTrunk
public abstract List<FoliagePlacer.FoliageAttachment> placeTrunk(LevelSimulatedReader level, BiConsumer<BlockPos, BlockState> blockSetter, RandomSource random, int freeTreeHeight, BlockPos pos, TreeConfiguration config) -
getTreeHeight
-
isDirt
-
setDirtAt
protected static void setDirtAt(LevelSimulatedReader level, BiConsumer<BlockPos, BlockState> blockSetter, RandomSource random, BlockPos pos, TreeConfiguration config) -
placeLog
protected boolean placeLog(LevelSimulatedReader level, BiConsumer<BlockPos, BlockState> blockSetter, RandomSource random, BlockPos pos, TreeConfiguration config) -
placeLog
protected boolean placeLog(LevelSimulatedReader level, BiConsumer<BlockPos, BlockState> blockSetter, RandomSource random, BlockPos pos, TreeConfiguration config, Function<BlockState, BlockState> propertySetter) -
placeLogIfFree
protected void placeLogIfFree(LevelSimulatedReader level, BiConsumer<BlockPos, BlockState> blockSetter, RandomSource random, BlockPos.MutableBlockPos pos, TreeConfiguration config) -
validTreePos
-
isFree
-