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 pRandom) private static boolean
isDirt
(LevelSimulatedReader pLevel, BlockPos pPos) boolean
isFree
(LevelSimulatedReader pLevel, BlockPos pPos) protected boolean
placeLog
(LevelSimulatedReader pLevel, BiConsumer<BlockPos, BlockState> pBlockSetter, RandomSource pRandom, BlockPos pPos, TreeConfiguration pConfig) protected boolean
placeLog
(LevelSimulatedReader pLevel, BiConsumer<BlockPos, BlockState> pBlockSetter, RandomSource pRandom, BlockPos pPos, TreeConfiguration pConfig, Function<BlockState, BlockState> pPropertySetter) protected void
placeLogIfFree
(LevelSimulatedReader pLevel, BiConsumer<BlockPos, BlockState> pBlockSetter, RandomSource pRandom, BlockPos.MutableBlockPos pPos, TreeConfiguration pConfig) abstract List
<FoliagePlacer.FoliageAttachment> placeTrunk
(LevelSimulatedReader pLevel, BiConsumer<BlockPos, BlockState> pBlockSetter, RandomSource pRandom, int pFreeTreeHeight, BlockPos pPos, TreeConfiguration pConfig) protected static void
setDirtAt
(LevelSimulatedReader pLevel, BiConsumer<BlockPos, BlockState> pBlockSetter, RandomSource pRandom, BlockPos pPos, TreeConfiguration pConfig) 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> p_70306_) protected abstract TrunkPlacerType
<?> type()
protected boolean
validTreePos
(LevelSimulatedReader pLevel, BlockPos pPos)
-
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 pBaseHeight, int pHeightRandA, int pHeightRandB)
-
-
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> p_70306_) -
type
-
placeTrunk
public abstract List<FoliagePlacer.FoliageAttachment> placeTrunk(LevelSimulatedReader pLevel, BiConsumer<BlockPos, BlockState> pBlockSetter, RandomSource pRandom, int pFreeTreeHeight, BlockPos pPos, TreeConfiguration pConfig) -
getTreeHeight
-
isDirt
-
setDirtAt
protected static void setDirtAt(LevelSimulatedReader pLevel, BiConsumer<BlockPos, BlockState> pBlockSetter, RandomSource pRandom, BlockPos pPos, TreeConfiguration pConfig) -
placeLog
protected boolean placeLog(LevelSimulatedReader pLevel, BiConsumer<BlockPos, BlockState> pBlockSetter, RandomSource pRandom, BlockPos pPos, TreeConfiguration pConfig) -
placeLog
protected boolean placeLog(LevelSimulatedReader pLevel, BiConsumer<BlockPos, BlockState> pBlockSetter, RandomSource pRandom, BlockPos pPos, TreeConfiguration pConfig, Function<BlockState, BlockState> pPropertySetter) -
placeLogIfFree
protected void placeLogIfFree(LevelSimulatedReader pLevel, BiConsumer<BlockPos, BlockState> pBlockSetter, RandomSource pRandom, BlockPos.MutableBlockPos pPos, TreeConfiguration pConfig) -
validTreePos
-
isFree
-