@@ -0,0 +1,2236 @@
+package com.japlj.healthydiet.food.playerstats;%0A%0Aimport com.japlj.healthydiet.ModConfig;%0Aimport com.japlj.healthydiet.food.FoodParameter;%0A%0Aimport net.minecraft.entity.Entity;%0Aimport net.minecraft.entity.player.EntityPlayer;%0Aimport net.minecraft.nbt.NBTTagCompound;%0Aimport net.minecraft.world.World;%0Aimport net.minecraftforge.common.IExtendedEntityProperties;%0A%0Apublic class PlayerNutritionalConditions implements IExtendedEntityProperties %7B%0A%09public final static String EXT_PROP_NAME = %22playerNutritionalConditions%22;%0A%09%0A%09private FoodParameter param = new FoodParameter(50.0F, 50.0F, 50.0F, 50.0F);%0A%09private final static String PROTEIN_VALUE_NAME = %22proteinValue%22;%0A%09private final static String CARBOHYDRATE_VALUE_NAME = %22carbohydrateValue%22;%0A%09private final static String VITA_MINE_VALUE_NAME = %22vitaMineValue%22;%0A%09private final static String FOOD_SATURATION_NAME = %22foodSaturation%22;%0A%09%0A%09public static void register(EntityPlayer player) %7B%0A%09%09player.registerExtendedProperties(EXT_PROP_NAME, new PlayerNutritionalConditions());%0A%09%7D%0A%09%0A%09public static PlayerNutritionalConditions get(EntityPlayer player) %7B%0A%09%09return (PlayerNutritionalConditions)player.getExtendedProperties(EXT_PROP_NAME);%0A%09%7D%0A%09%0A%09@Override%0A%09public void saveNBTData(NBTTagCompound nbtOut) %7B%0A%09%09NBTTagCompound nbt = new NBTTagCompound();%0A%09%09%0A%09%09nbt.setFloat(PROTEIN_VALUE_NAME, param.proteinValue);%0A%09%09nbt.setFloat(CARBOHYDRATE_VALUE_NAME, param.carbohydrateValue);%0A%09%09nbt.setFloat(VITA_MINE_VALUE_NAME, param.vitaMineValue);%0A%09%09nbt.setFloat(FOOD_SATURATION_NAME, param.saturation);%0A%09%09%0A%09%09nbtOut.setTag(EXT_PROP_NAME, nbt);%0A%09%7D%0A%09%0A%09@Override%0A%09public void loadNBTData(NBTTagCompound nbtIn) %7B%0A%09%09NBTTagCompound nbt = (NBTTagCompound)nbtIn.getTag(EXT_PROP_NAME);%0A%09%09%0A%09%09this.param.proteinValue = nbt.getFloat(PROTEIN_VALUE_NAME);%0A%09%09this.param.carbohydrateValue = nbt.getFloat(CARBOHYDRATE_VALUE_NAME);%0A%09%09this.param.vitaMineValue = nbt.getFloat(VITA_MINE_VALUE_NAME);%0A%09%09this.param.saturation = nbt.getFloat(FOOD_SATURATION_NAME);%0A%09%7D%0A%09%0A%09@Override%0A%09public void init(Entity entitiy, World world) %7B %7D%0A%09%0A%09public FoodParameter getFoodParameter() %7B%0A%09%09return param;%0A%09%7D%0A%09%0A%09public boolean isEdible(FoodParameter foodParam) %7B%0A%09%09return param.saturation + foodParam.saturation %3C= ModConfig.MAX_NUTRITION_VALUE;%0A%09%7D%0A%7D%0A

Implement extended player properties representing nutritional conditions