Remove duplication in item listener code by making item crafting and item smelting use the same code.