A man has been jailed after police discovered chemicals and explosives when raiding a house in Yorkshire.