package net.tropicraft.core.common.block;

import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.IPlantable;

public final class MudBlock extends Block {
    private static final VoxelShape SHAPE = Block.box(0.0, 0.0, 0.0, 16.0, 14.0, 16.0);

    public MudBlock(Properties properties) {
        super(properties);
    }

    @Override
    public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
        return SHAPE;
    }

    @Override
    public VoxelShape getBlockSupportShape(BlockState state, BlockGetter world, BlockPos pos) {
        return Shapes.block();
    }

    @Override
    public VoxelShape getVisualShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
        return Shapes.block();
    }

    @Override
    public boolean canSustainPlant(BlockState state, BlockGetter world, BlockPos pos, Direction facing, IPlantable plantable) {
        return Blocks.DIRT.canSustainPlant(state, world, pos, facing, plantable);
    }

    @Override
    public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, PathComputationType type) {
        return false;
    }

    @Override
    @Deprecated
    @OnlyIn(Dist.CLIENT)
    public float getShadeBrightness(BlockState state, BlockGetter world, BlockPos pos) {
        return 0.2F;
    }
}

@@ -134,31 +134,118 @@
 aft.
-world.level.BlockGetter
+server.level.ServerLevel;%0Aimport net.minecraft.world.level.BlockGetter;%0Aimport net.minecraft.world.level.Level
 ;%0Aim
@@ -335,16 +335,74 @@
 Blocks;%0A
+import net.minecraft.world.level.block.BonemealableBlock;%0A
 import n
@@ -810,16 +810,92 @@
 antable;
+%0Aimport net.tropicraft.core.common.TropicraftTags;%0A%0Aimport java.util.Random;
 %0A%0Apublic
@@ -930,16 +930,45 @@
 s Block 
+implements BonemealableBlock 
 %7B%0A    pr
@@ -2164,11 +2164,1491 @@
 F;%0A    %7D
+%0A%0A    public boolean isValidBonemealTarget(BlockGetter pLevel, BlockPos pPos, BlockState pState, boolean pIsClient) %7B%0A        return pLevel.getBlockState(pPos.above()).isAir();%0A    %7D%0A%0A    public boolean isBonemealSuccess(Level pLevel, Random pRand, BlockPos pPos, BlockState pState) %7B%0A        return true;%0A    %7D%0A%0A    public void performBonemeal(ServerLevel pLevel, Random pRand, BlockPos pPos, BlockState pState) %7B%0A        mainLoop:%0A        for(int i = 0; i %3C 96; ++i) %7B%0A            BlockPos blockpos1 = pPos.above();%0A%0A            for(int j = 0; j %3C i / 16; ++j) %7B%0A                blockpos1 = blockpos1.offset(pRand.nextInt(3) - 1, (pRand.nextInt(3) - 1) * pRand.nextInt(3) / 2, pRand.nextInt(3) - 1);%0A                if (!pLevel.getBlockState(blockpos1.below()).is(TropicraftTags.Blocks.MUD) %7C%7C pLevel.getBlockState(blockpos1).isCollisionShapeFullBlock(pLevel, blockpos1)) %7B%0A                    continue mainLoop;%0A                %7D%0A            %7D%0A%0A            BlockState blockstate1 = pLevel.getBlockState(blockpos1);%0A            if (blockstate1.is(TropicraftTags.Blocks.MUD) && pRand.nextInt(10) == 0) %7B%0A                ((BonemealableBlock)TropicraftBlocks.MUD.get()).performBonemeal(pLevel, pRand, blockpos1, blockstate1);%0A            %7D else if (blockstate1.isAir()) %7B%0A                if (pRand.nextInt(2) == 0) %7B%0A                    pLevel.setBlock(blockpos1, TropicraftBlocks.REEDS.get().defaultBlockState(), Block.UPDATE_ALL);%0A                %7D%0A            %7D%0A        %7D%0A%0A    %7D
 %0A%7D%0A

Add ability to Bonemeal mud for reeds (#503)