Added an onInventoryChanged to TInventory to trigger events