Added support for inventory larger than 256 slots