pass the crafting inventory as a const reference to avoid copying