content: package thebetweenlands.common.block.structure;
  
  import net.minecraft.block.Block;
  import net.minecraft.block.BlockHorizontal;
  import net.minecraft.block.SoundType;
  import net.minecraft.block.material.Material;
  import net.minecraft.block.properties.IProperty;
  import net.minecraft.block.properties.PropertyBool;
  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.init.MobEffects;
  import net.minecraft.item.ItemStack;
  import net.minecraft.potion.PotionEffect;
  import net.minecraft.util.BlockRenderLayer;
  import net.minecraft.util.EnumBlockRenderType;
  import net.minecraft.util.EnumFacing;
  import net.minecraft.util.EnumHand;
  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.world.IBlockAccess;
  import net.minecraft.world.World;
  import net.minecraftforge.fml.relauncher.Side;
  import net.minecraftforge.fml.relauncher.SideOnly;
  import thebetweenlands.client.tab.BLCreativeTabs;
  import thebetweenlands.common.registries.BlockRegistry.IStateMappedBlock;
  import thebetweenlands.util.AdvancedStateMap.Builder;
  
  public class BlockWalkway extends Block implements IStateMappedBlock {
  	public static final PropertyDirection FACING = BlockHorizontal.FACING;
  	public static final PropertyBool STANDS = PropertyBool.create("has_stands");
  
  	protected static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0.0F, 0, 1.0F, 0.6F, 1.0F);
  
  	public BlockWalkway() {
  		super(Material.WOOD);
  		this.setSoundType(SoundType.WOOD);
  		this.setHardness(1.0F);
  		this.setCreativeTab(BLCreativeTabs.BLOCKS);
  		this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(STANDS, true));
  	}
  
  	@Override
  	public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
  		return AABB;
  	}
  
  	@Override
  	public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
  		return state.withProperty(STANDS, worldIn.getBlockState(pos.down()).isSideSolid(worldIn, pos.down(), EnumFacing.UP));
  	}
  
  	@Override
  	public EnumBlockRenderType getRenderType(IBlockState state) {
  		return EnumBlockRenderType.MODEL;
  	}
  
  	@Override
  	@SideOnly(Side.CLIENT)
  	public BlockRenderLayer getRenderLayer() {
  		return BlockRenderLayer.CUTOUT;
  	}
  
  	@Override
  	public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
  		return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
  	}
  
  	@Override
  	public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
  		world.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing().getOpposite()), 2);
  	}
  
  	@Override
  	public IBlockState getStateFromMeta(int meta) {
  		EnumFacing enumfacing = EnumFacing.byIndex(meta);
  
  		if (enumfacing.getAxis() == EnumFacing.Axis.Y) {
  			enumfacing = EnumFacing.NORTH;
  		}
  
  		return getDefaultState().withProperty(FACING, enumfacing);
  	}
  
  	@Override
  	public int getMetaFromState(IBlockState state) {
  		return ((EnumFacing) state.getValue(FACING)).getIndex();
  	}
  
  	@Override
  	public IBlockState withRotation(IBlockState state, Rotation rot) {
  		return state.withProperty(FACING, rot.rotate((EnumFacing) state.getValue(FACING)));
  	}
  
  	@Override
  	public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
  		return state.withRotation(mirrorIn.toRotation((EnumFacing) state.getValue(FACING)));
  	}
  
  	@Override
  	protected BlockStateContainer createBlockState() {
  		return new BlockStateContainer(this, new IProperty[] { FACING, STANDS });
  	}
  
  	@Override
  	@SideOnly(Side.CLIENT)
  	public void setStateMapper(Builder builder) {
  		builder.withPropertySuffixFalse(STANDS, "no_stands").ignore(STANDS);
  	}
  
  	@Override
  	public boolean isOpaqueCube(IBlockState state) {
  		return false;
  	}
  
  	@Override
  	public boolean isFullCube(IBlockState state) {
  		return false;
  	}
  
  	@Override
  	public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
  		if(entityIn instanceof EntityLivingBase) {
  			((EntityLivingBase)entityIn).addPotionEffect(new PotionEffect(MobEffects.SPEED, 1, 1, false, false));
  		}
  	}
  	
  	@Override
      public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) {
      	return BlockFaceShape.UNDEFINED;
      }
  }
  