package squeek.appleskin.helpers;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import squeek.appleskin.AppleSkin;

public class FoodHelper
{
	public static class BasicFoodValues
	{
		public final int hunger;
		public final float saturationModifier;

		public BasicFoodValues(int hunger, float saturationModifier)
		{
			this.hunger = hunger;
			this.saturationModifier = saturationModifier;
		}

		public float getSaturationIncrement()
		{
			return Math.min(20, hunger * saturationModifier * 2f);
		}
	}

	public static boolean isFood(ItemStack itemStack)
	{
		if (AppleSkin.hasAppleCore)
			return AppleCoreHelper.isFood(itemStack);

		return itemStack.getItem() instanceof ItemFood;
	}

	public static BasicFoodValues getDefaultFoodValues(ItemStack itemStack)
	{
		if (AppleSkin.hasAppleCore)
			return AppleCoreHelper.getDefaultFoodValues(itemStack);

		ItemFood itemFood = (ItemFood) itemStack.getItem();
		int hunger = itemFood.getHealAmount(itemStack);
		float saturationModifier = itemFood.getSaturationModifier(itemStack);

		return new BasicFoodValues(hunger, saturationModifier);
	}

	public static BasicFoodValues getModifiedFoodValues(ItemStack itemStack, EntityPlayer player)
	{
		if (AppleSkin.hasAppleCore)
			return AppleCoreHelper.getModifiedFoodValues(itemStack, player);

		return getDefaultFoodValues(itemStack);
	}
}

@@ -572,16 +572,496 @@
 2f);%0A%09%09%7D
+%0A%0A%09%09@Override%0A%09%09public boolean equals(Object o)%0A%09%09%7B%0A%09%09%09if (this == o) return true;%0A%09%09%09if (!(o instanceof BasicFoodValues)) return false;%0A%0A%09%09%09BasicFoodValues that = (BasicFoodValues) o;%0A%0A%09%09%09return hunger == that.hunger && Float.compare(that.saturationModifier, saturationModifier) == 0;%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public int hashCode()%0A%09%09%7B%0A%09%09%09int result = hunger;%0A%09%09%09result = 31 * result + (saturationModifier != +0.0f ? Float.floatToIntBits(saturationModifier) : 0);%0A%09%09%09return result;%0A%09%09%7D
 %0A%09%7D%0A%0A%09pu

Implement equals/hashCode in AppleSkin's FoodValues class