TileEntity te = worldObj.getTileEntity(pos);
if (te == null)
{
return false;
}
<BUG>return te instanceof IInventory;
}</BUG>
@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
{

TileEntity te = worldObj.getTileEntity(pos);
if (te == null)
{
return false;
}
return te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing.getOpposite());
}
@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
{
