content: package thebetweenlands.common.block.terrain;
  
  import net.minecraft.block.BlockLog;
  import net.minecraft.block.state.BlockStateContainer;
  import net.minecraft.block.state.IBlockState;
  import net.minecraft.creativetab.CreativeTabs;
  import net.minecraft.entity.EntityLivingBase;
  import net.minecraft.entity.player.EntityPlayer;
  import net.minecraft.item.Item;
  import net.minecraft.item.ItemBlock;
  import net.minecraft.item.ItemStack;
  import net.minecraft.util.EnumFacing;
  import net.minecraft.util.NonNullList;
  import net.minecraft.util.math.BlockPos;
  import net.minecraft.util.math.RayTraceResult;
  import net.minecraft.world.World;
  import thebetweenlands.client.tab.BLCreativeTabs;
  import thebetweenlands.common.registries.BlockRegistry.ICustomItemBlock;
  import thebetweenlands.common.registries.BlockRegistry.ISubtypeItemBlockModelDefinition;
  
  public class BlockLogBetweenlands extends BlockLog implements ISubtypeItemBlockModelDefinition, ICustomItemBlock {
  	public BlockLogBetweenlands() {
  		setHarvestLevel("axe", 0);
  		setCreativeTab(BLCreativeTabs.PLANTS);
  		setDefaultState(blockState.getBaseState().withProperty(LOG_AXIS, BlockLog.EnumAxis.Y));
  		this.setCreativeTab(BLCreativeTabs.BLOCKS);
  	}
  
  	
  	@Override
  	public void getSubBlocks(CreativeTabs item, NonNullList<ItemStack> items) {
  		items.add(new ItemStack(this, 1, 0));
  		items.add(new ItemStack(this, 1, 12));
  	}
  
  	@Override
  	public IBlockState getStateFromMeta(int meta) {
  		IBlockState state = getDefaultState();
  		switch (meta & 12) {
  		case 0:
  			state = state.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y);
  			break;
  		case 4:
  			state = state.withProperty(LOG_AXIS, BlockLog.EnumAxis.X);
  			break;
  		case 8:
  			state = state.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z);
  			break;
  		default:
  			state = state.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE);
  		}
  
  		return state;
  	}
  
  	@Override
  	@SuppressWarnings("incomplete-switch")
  	public int getMetaFromState(IBlockState state) {
  		int meta = 0;
  		switch (state.getValue(LOG_AXIS)) {
  		case X:
  			meta |= 4;
  			break;
  		case Z:
  			meta |= 8;
  			break;
  		case NONE:
  			meta |= 12;
  			break;
  		}
  
  		return meta;
  	}
  
  	@Override
  	protected BlockStateContainer createBlockState() {
  		return new BlockStateContainer.Builder(this).add(LOG_AXIS).build();
  	}
  
  	@Override
  	public int damageDropped(IBlockState state) {
  		if(state.getValue(LOG_AXIS) == BlockLog.EnumAxis.NONE) {
  			return 12;
  		}
  		return 0;
  	}
  
  	@Override
  	public int getSubtypeNumber() {
  		return 2;
  	}
  
  	@Override
  	public int getSubtypeMeta(int subtype) {
  		switch(subtype) {
  		default:
  		case 0:
  			return 0;
  		case 1:
  			return 12;
  		}
  	}
  
  	@Override
  	public String getSubtypeName(int meta) {
  		switch(meta) {
  		default:
  		case 0:
  			return "%s";
  		case 12:
  			return "%s_full";
  		}
  	}
  
  	@Override
  	public ItemBlock getItemBlock() {
  		ItemBlock item = new ItemBlock(this) {
  			@Override
  			public int getMetadata(int damage) {
  				return damage;
  			}
  		};
  		item.setHasSubtypes(true);
  		return item;
  	}
  
  	@Override
  	public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
  		return new ItemStack(Item.getItemFromBlock(this), 1, state.getValue(LOG_AXIS) == BlockLog.EnumAxis.NONE ? 12 : 0);
  	}
  	
  	@Override
  	public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
          if(meta != 12) {
          	return this.getStateFromMeta(meta).withProperty(LOG_AXIS, BlockLog.EnumAxis.fromFacingAxis(facing.getAxis()));
          }
          return this.getDefaultState().withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE);
      }
  }