content: package thebetweenlands.common.block.structure;
  
  import java.util.List;
  import java.util.Random;
  
  import javax.annotation.Nullable;
  
  import net.minecraft.block.SoundType;
  import net.minecraft.block.material.Material;
  import net.minecraft.block.properties.PropertyDirection;
  import net.minecraft.block.state.BlockFaceShape;
  import net.minecraft.block.state.BlockStateContainer;
  import net.minecraft.block.state.IBlockState;
  import net.minecraft.entity.Entity;
  import net.minecraft.entity.EntityLivingBase;
  import net.minecraft.util.EnumBlockRenderType;
  import net.minecraft.util.EnumFacing;
  import net.minecraft.util.Mirror;
  import net.minecraft.util.Rotation;
  import net.minecraft.util.math.AxisAlignedBB;
  import net.minecraft.util.math.BlockPos;
  import net.minecraft.util.math.MathHelper;
  import net.minecraft.world.IBlockAccess;
  import net.minecraft.world.World;
  import thebetweenlands.common.block.BasicBlock;
  
  public class BlockMudBricksClimbable extends BasicBlock {
  	public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
      protected static final AxisAlignedBB LADDER_EAST_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.99, 1.0D, 1.0D);
      protected static final AxisAlignedBB LADDER_WEST_AABB = new AxisAlignedBB(0.01D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
      protected static final AxisAlignedBB LADDER_SOUTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.99D);
      protected static final AxisAlignedBB LADDER_NORTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.01D, 1.0D, 1.0D, 1.0D);
  
  	public BlockMudBricksClimbable() {
  		this(Material.ROCK);
  	}
  
  	public BlockMudBricksClimbable(Material material) {
  		super(material);
  		setHardness(0.4f);
  		setSoundType(SoundType.STONE);
  		setHarvestLevel("pickaxe", 0);
  		setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
  		setLightOpacity(191);
  	}
  
  	@Override
  	public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
  		switch (state.getValue(FACING)) {
  		case NORTH:
  			return LADDER_NORTH_AABB;
  		case SOUTH:
  			return LADDER_SOUTH_AABB;
  		case WEST:
  			return LADDER_WEST_AABB;
  		case EAST:
  		default:
  			return LADDER_EAST_AABB;
  		}
  	}
  	
  	@Override
  	public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean whatIsThis) {
  		state = state.getActualState(worldIn, pos);
  		switch (state.getValue(FACING)) {
  			default:
  			case EAST:
  				addCollisionBoxToList(pos, entityBox, collidingBoxes, LADDER_EAST_AABB);
  				break;
  			case WEST:
  				addCollisionBoxToList(pos, entityBox, collidingBoxes, LADDER_WEST_AABB);
  				break;
  			case SOUTH:
  				addCollisionBoxToList(pos, entityBox, collidingBoxes, LADDER_SOUTH_AABB);
  				break;
  			case NORTH:
  				addCollisionBoxToList(pos, entityBox, collidingBoxes, LADDER_NORTH_AABB);
  				break;
  		}
  	}
  
  	@Override
  	public EnumBlockRenderType getRenderType(IBlockState state) {
  		return EnumBlockRenderType.MODEL;
  	}
  
  	@Override
  	public boolean isOpaqueCube(IBlockState state) {
  		return false;
  	}
  
  	@Override
  	public void onEntityCollision(World world, BlockPos pos, IBlockState state, Entity entity) {
          entity.motionX = MathHelper.clamp(entity.motionX, -0.15000000596046448D, 0.15000000596046448D);
          entity.motionZ = MathHelper.clamp(entity.motionZ, -0.15000000596046448D, 0.15000000596046448D);
          entity.fallDistance = 0.0F;
  
          if (entity.motionY < -0.15D)
          	entity.motionY = -0.15D;
  
          if (entity.motionY < 0.0D)
          	entity.motionY = 0.0D;
  
          if (entity.collidedHorizontally)
          	entity.motionY = 0.2D;
  	}
  
  	@Override
  	public IBlockState getStateFromMeta(int meta) {
  		EnumFacing facing = EnumFacing.byIndex(meta); // Using this instead of 'byHorizontalIndex' because the ids don't match and previous was release
  		return getDefaultState().withProperty(FACING, facing.getAxis().isHorizontal() ? facing: EnumFacing.NORTH);
  	}
  
  	@Override
  	public int getMetaFromState(IBlockState state) {
  		int meta = 0;
  		meta = meta | state.getValue(FACING).getIndex();
  		return meta;
  	}
  
  	@Override
  	public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
  		return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
  	}
  
  	@Override
  	public IBlockState withRotation(IBlockState state, Rotation rot) {
  		return state.withProperty(FACING, rot.rotate(state.getValue(FACING)));
  	}
  
  	@Override
  	public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
  		return state.withRotation(mirrorIn.toRotation(state.getValue(FACING)));
  	}
  
  	@Override
  	protected BlockStateContainer createBlockState() {
  		return new BlockStateContainer(this, FACING);
  	}
  
  	@Override
  	public int quantityDropped(Random random) {
  		return 1;
  	}
  
  	@Override
  	public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing face) {
  		return BlockFaceShape.UNDEFINED;
  	}
  }
  