content: package thebetweenlands.common.block.container;
  
  import javax.annotation.Nullable;
  
  import net.minecraft.block.BlockContainer;
  import net.minecraft.block.material.Material;
  import net.minecraft.block.state.BlockFaceShape;
  import net.minecraft.block.state.IBlockState;
  import net.minecraft.entity.item.EntityItem;
  import net.minecraft.entity.player.EntityPlayer;
  import net.minecraft.inventory.InventoryHelper;
  import net.minecraft.item.ItemStack;
  import net.minecraft.tileentity.TileEntity;
  import net.minecraft.util.BlockRenderLayer;
  import net.minecraft.util.EnumBlockRenderType;
  import net.minecraft.util.EnumFacing;
  import net.minecraft.util.EnumHand;
  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.fluids.FluidUtil;
  import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
  import net.minecraftforge.fluids.capability.IFluidHandler;
  import net.minecraftforge.fml.relauncher.Side;
  import net.minecraftforge.fml.relauncher.SideOnly;
  import thebetweenlands.client.tab.BLCreativeTabs;
  import thebetweenlands.common.tile.TileEntityGrubHub;
  
  public class BlockGrubHub extends BlockContainer {
  	
  	private static final AxisAlignedBB AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375, 1.0D, 0.9375D);
  
  	public BlockGrubHub() {
  		super(Material.WOOD);
  		setHardness(2.0F);
  		setResistance(5.0F);
  		setCreativeTab(BLCreativeTabs.BLOCKS);
  	}
  
  	@Override
  	public TileEntity createNewTileEntity(World world, int meta) {
  		return new TileEntityGrubHub();
  	}
  	
  	@Override
  	public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
  		return AABB;
  	}
  
  	@Override
  	public EnumBlockRenderType getRenderType(IBlockState state) {
  		return EnumBlockRenderType.MODEL;
  	}
  
  	@Override
  	@SideOnly(Side.CLIENT)
  	public BlockRenderLayer getRenderLayer() {
  		return BlockRenderLayer.TRANSLUCENT;
  	}
  
  	@Override
  	@SideOnly(Side.CLIENT)
  	public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
  		return true;
  	}
  
  	@Override
  	public boolean isOpaqueCube(IBlockState state) {
  		return false;
  	}
  
  	@Override
  	public boolean isFullCube(IBlockState state) {
  		return false;
  	}
  
  	@Override
      public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) {
      	return BlockFaceShape.UNDEFINED;
      }
  
  	@Override
  	public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
  		if (world.getTileEntity(pos) instanceof TileEntityGrubHub) {
  			TileEntityGrubHub tile = (TileEntityGrubHub) world.getTileEntity(pos);
  			if (FluidUtil.getFluidHandler(player.getHeldItem(hand)) == null && hand == EnumHand.MAIN_HAND) {
  				if (!tile.getStackInSlot(0).isEmpty()) {
  					if (!world.isRemote) {
  						ItemStack extracted = tile.getStackInSlot(0).copy();
  						if(!player.isSneaking())
  							extracted.setCount(1);
  						EntityItem item = new EntityItem(world, pos.getX() + 0.5D, pos.getY() + 1.0D, pos.getZ() + 0.5D, extracted);
  						item.motionX = item.motionY = item.motionZ = 0D;
  						world.spawnEntity(item);
  						if(!player.isSneaking())
  							tile.getStackInSlot(0).shrink(1);
  						else
  							tile.setInventorySlotContents(0, ItemStack.EMPTY);
  						tile.markForUpdate();
  					}
  					player.swingArm(hand);
  					return true;
  				}
  			}
  		}
  
  		final IFluidHandler fluidHandler = getFluidHandler(world, pos);
  		if (fluidHandler != null) {
  			FluidUtil.interactWithFluidHandler(player, hand, world, pos, side);
  			return FluidUtil.getFluidHandler(player.getHeldItem(hand)) != null;
  		}
  		return false;
  	}
  
  	@Override
  	public void breakBlock(World world, BlockPos pos, IBlockState state) {
  		TileEntityGrubHub tile = (TileEntityGrubHub) world.getTileEntity(pos);
  		if (tile != null) {
  			InventoryHelper.dropInventoryItems(world, pos, tile);
  			world.removeTileEntity(pos);
  		}
  		super.breakBlock(world, pos, state);
  	}
  
  	@Nullable
  	private IFluidHandler getFluidHandler(IBlockAccess world, BlockPos pos) {
  		TileEntityGrubHub tileentity = (TileEntityGrubHub) world.getTileEntity(pos);
  		return tileentity.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null);
  	}
  }
  