added support for ISidedInvenotry

also improved algorithm to ignore unnecessary inventory checks