package com.japlj.healthydiet.api;

import com.japlj.healthydiet.food.FoodParameterManager;

import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;

public final class NutritionUtils {
	private NutritionUtils() { }
	
	/*
	 * アイテム item に栄養素情報が設定されているか
	 */
	public boolean hasNutritionalInfo(ItemStack items) {
		if (!(items.getItem() instanceof ItemFood)) {
			return false;
		}
		
		if (items.getItem() instanceof ItemNutriousFood) {
			return true;
		}
		
		return FoodParameterManager.hasNutritionalInfo(items);
	}
}

@@ -29,16 +29,65 @@
 t.api;%0A%0A
+import com.japlj.healthydiet.food.FoodParameter;%0A
 import c
@@ -578,10 +578,301 @@
 ms);%0A%09%7D%0A
+%09%0A%09/*%0A%09 * %E3%82%A2%E3%82%A4%E3%83%86%E3%83%A0 item %E3%81%AB%E8%A8%AD%E5%AE%9A%E3%81%95%E3%82%8C%E3%81%9F%E6%A0%84%E9%A4%8A%E7%B4%A0%E6%83%85%E5%A0%B1%E3%82%92%E5%8F%96%E5%BE%97%0A%09 */%0A%09public FoodParameter getNutritionalValues(ItemStack items) %7B%0A%09%09if (items.getItem() instanceof ItemNutriousFood) %7B%0A%09%09%09return ((ItemNutriousFood)items.getItem()).getNutritionalValues();%0A%09%09%7D%0A%09%09return FoodParameterManager.getNutritionalValues(items);%0A%09%7D%0A
 %7D%0A

Add an utility function to fetch nutritional values of foods