content: package thebetweenlands.common.block.terrain;
  
  import java.util.Random;
  
  import net.minecraft.block.Block;
  import net.minecraft.block.SoundType;
  import net.minecraft.block.material.Material;
  import net.minecraft.block.state.IBlockState;
  import net.minecraft.entity.Entity;
  import net.minecraft.item.Item;
  import net.minecraft.util.BlockRenderLayer;
  import net.minecraft.util.EnumFacing;
  import net.minecraft.util.math.AxisAlignedBB;
  import net.minecraft.util.math.BlockPos;
  import net.minecraft.world.IBlockAccess;
  import net.minecraft.world.World;
  import net.minecraftforge.fml.relauncher.Side;
  import net.minecraftforge.fml.relauncher.SideOnly;
  import thebetweenlands.api.entity.IEntityBL;
  import thebetweenlands.client.tab.BLCreativeTabs;
  import thebetweenlands.common.registries.BlockRegistry;
  
  public class BlockSludgyDirt extends Block {
  	private static final AxisAlignedBB BOUNDING_BOX = new AxisAlignedBB(0, 0, 0, 1, 1 - 0.125F, 1);
  
  	public BlockSludgyDirt() {
  		super(Material.GRASS);
  		setHardness(0.5F);
  		setSoundType(SoundType.GROUND);
  		setHarvestLevel("shovel", 0);
  		setCreativeTab(BLCreativeTabs.BLOCKS);
  		setTickRandomly(true);
  	}
  
  	@Override
  	public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
  		if (!worldIn.isRemote) {
  			IBlockState blockStateAbove = worldIn.getBlockState(pos.up());
  			if(blockStateAbove.getLightOpacity(worldIn, pos.up()) > 2 || blockStateAbove.getBlock() == this) {
  				worldIn.setBlockState(pos, BlockRegistry.SWAMP_DIRT.getDefaultState());
  			}
  		}
  	}
  
  	@Override
  	public Item getItemDropped(IBlockState state, Random rand, int fortune) {
  		return BlockRegistry.SWAMP_DIRT.getItemDropped(state, rand, fortune);
  	}
  
  	@Override
  	public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) {
  		return BOUNDING_BOX;
  	}
  
  	@Override
  	public void onEntityCollision(World world, BlockPos pos, IBlockState state, Entity entity){
  		if(entity instanceof IEntityBL == false) entity.setInWeb();
  	}
  
  	@Override
  	public boolean isOpaqueCube(IBlockState s) {
  		return false;
  	}
  
  	@Override
  	@SideOnly(Side.CLIENT)
  	public BlockRenderLayer getRenderLayer() {
  		return BlockRenderLayer.TRANSLUCENT;
  	}
  
  	@Override
  	public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess iblockaccess, BlockPos pos, EnumFacing side) {
  		Block block = iblockaccess.getBlockState(pos.offset(side)).getBlock();
  		return block instanceof BlockSludgyDirt == false && block instanceof BlockSpreadingSludgyDirt == false;
  	}
  }
  