fn matching_item_count( stack: &ItemStack, predicate: &(impl Fn(&ItemStack) -> bool + ?Sized), amount_to_remove: i32, counting_only: bool, ) -> i32