Search in sources :

Example 1 with HugePlantBlock

use of net.tropicraft.core.common.block.huge_plant.HugePlantBlock in project Tropicraft by Tropicraft.

the class GrowableDoublePlantBlock method performBonemeal.

@Override
public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) {
    BlockPos lowerPos = state.getValue(HALF) == DoubleBlockHalf.LOWER ? pos : pos.below();
    HugePlantBlock growBlock = this.growInto.get().get();
    BlockState growState = growBlock.defaultBlockState();
    if (growState.canSurvive(world, lowerPos)) {
        growBlock.placeAt(world, lowerPos, Constants.BlockFlags.BLOCK_UPDATE);
    }
}
Also used : HugePlantBlock(net.tropicraft.core.common.block.huge_plant.HugePlantBlock) BlockState(net.minecraft.world.level.block.state.BlockState) BlockPos(net.minecraft.core.BlockPos)

Example 2 with HugePlantBlock

use of net.tropicraft.core.common.block.huge_plant.HugePlantBlock in project Tropicraft by Tropicraft.

the class HugePlantBlockPlacer method place.

@Override
public void place(LevelAccessor world, BlockPos pos, BlockState state, Random random) {
    HugePlantBlock block = (HugePlantBlock) state.getBlock();
    block.placeAt(world, pos, Block.UPDATE_CLIENTS);
}
Also used : HugePlantBlock(net.tropicraft.core.common.block.huge_plant.HugePlantBlock)

Aggregations

HugePlantBlock (net.tropicraft.core.common.block.huge_plant.HugePlantBlock)2 BlockPos (net.minecraft.core.BlockPos)1 BlockState (net.minecraft.world.level.block.state.BlockState)1