// Path: src/main/java/ca/wescook/nutrition/capabilities/INutrientManager.java
// public interface INutrientManager {
// 	// Return all nutrients and values
// 	Map<Nutrient, Float> get();
// 
// 	// Return value of specific nutrient
// 	Float get(Nutrient nutrient);
// 
// 	// Set value of specific nutrient
// 	void set(Nutrient nutrient, Float value);
// 
// 	// Update all nutrients
// 	void set(Map<Nutrient, Float> nutrientData);
// 
// 	// Increase specific nutrient by amount
// 	void add(Nutrient nutrient, float amount);
// 
// 	// Increase list of nutrients by amount
// 	void add(List<Nutrient> nutrientData, float amount);
// 
// 	// Decrease specific nutrient by amount
// 	void subtract(Nutrient nutrient, float amount);
// 
// 	// Decrease list of nutrients by amount
// 	void subtract(List<Nutrient> nutrientData, float amount);
// 
// 	// Reset specific nutrient to default nutrition
// 	void reset(Nutrient nutrient);
// 
// 	// Reset all nutrients to default nutrition
// 	void reset();
// 
// 	// Internal: Called to update Nutrient object references in player's capability
// 	void updateCapability();
// }
// 
// Path: src/main/java/ca/wescook/nutrition/nutrients/Nutrient.java
// public class Nutrient {
// 	public String name;
// 	public ItemStack icon;
// 	public int color;
// 	public float decay;
// 	public boolean visible;
// 	public List<String> foodOreDict = new ArrayList<>();
// 	public List<ItemStack> foodItems = new ArrayList<>();
// }


import ca.wescook.nutrition.capabilities.INutrientManager;
import ca.wescook.nutrition.nutrients.Nutrient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.PotionEffect;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
package ca.wescook.nutrition.effects;



public class EffectsManager {
	@CapabilityInject(INutrientManager.class)
	private static final Capability<INutrientManager> NUTRITION_CAPABILITY = null;

	// Called from EventWorldTick#PlayerTickEvent and EventEatFood#reapplyEffectsFromMilk
	public static void reapplyEffects(EntityPlayer player) {
		List<Effect> effects = removeDuplicates(getEffectsInThreshold(player));

		for (Effect effect : effects) {
			boolean ambient = (effect.particles == Effect.ParticleVisibility.TRANSLUCENT); // Determine if particles should be shown, and what strength
			boolean showParticles = (effect.particles == Effect.ParticleVisibility.TRANSLUCENT || effect.particles == Effect.ParticleVisibility.OPAQUE);
			player.addPotionEffect(new PotionEffect(effect.potion, 619, effect.amplifier, ambient, showParticles));
		}
	}

	// Returns which effects match threshold conditions
	private static List<Effect> getEffectsInThreshold(EntityPlayer player) {
		// List of effects being turned on
		List<Effect> effectsInThreshold = new ArrayList<>();

		// Get player nutrition
// Path: src/main/java/ca/wescook/nutrition/capabilities/INutrientManager.java
// public interface INutrientManager {
// 	// Return all nutrients and values
// 	Map<Nutrient, Float> get();
// 
// 	// Return value of specific nutrient
// 	Float get(Nutrient nutrient);
// 
// 	// Set value of specific nutrient
// 	void set(Nutrient nutrient, Float value);
// 
// 	// Update all nutrients
// 	void set(Map<Nutrient, Float> nutrientData);
// 
// 	// Increase specific nutrient by amount
// 	void add(Nutrient nutrient, float amount);
// 
// 	// Increase list of nutrients by amount
// 	void add(List<Nutrient> nutrientData, float amount);
// 
// 	// Decrease specific nutrient by amount
// 	void subtract(Nutrient nutrient, float amount);
// 
// 	// Decrease list of nutrients by amount
// 	void subtract(List<Nutrient> nutrientData, float amount);
// 
// 	// Reset specific nutrient to default nutrition
// 	void reset(Nutrient nutrient);
// 
// 	// Reset all nutrients to default nutrition
// 	void reset();
// 
// 	// Internal: Called to update Nutrient object references in player's capability
// 	void updateCapability();
// }
// 
// Path: src/main/java/ca/wescook/nutrition/nutrients/Nutrient.java
// public class Nutrient {
// 	public String name;
// 	public ItemStack icon;
// 	public int color;
// 	public float decay;
// 	public boolean visible;
// 	public List<String> foodOreDict = new ArrayList<>();
// 	public List<ItemStack> foodItems = new ArrayList<>();
// }


// Path: src/main/java/ca/wescook/nutrition/effects/EffectsManager.java
import ca.wescook.nutrition.capabilities.INutrientManager;
import ca.wescook.nutrition.nutrients.Nutrient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.PotionEffect;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

package ca.wescook.nutrition.effects;



public class EffectsManager {
	@CapabilityInject(INutrientManager.class)
	private static final Capability<INutrientManager> NUTRITION_CAPABILITY = null;

	// Called from EventWorldTick#PlayerTickEvent and EventEatFood#reapplyEffectsFromMilk
	public static void reapplyEffects(EntityPlayer player) {
		List<Effect> effects = removeDuplicates(getEffectsInThreshold(player));

		for (Effect effect : effects) {
			boolean ambient = (effect.particles == Effect.ParticleVisibility.TRANSLUCENT); // Determine if particles should be shown, and what strength
			boolean showParticles = (effect.particles == Effect.ParticleVisibility.TRANSLUCENT || effect.particles == Effect.ParticleVisibility.OPAQUE);
			player.addPotionEffect(new PotionEffect(effect.potion, 619, effect.amplifier, ambient, showParticles));
		}
	}

	// Returns which effects match threshold conditions
	private static List<Effect> getEffectsInThreshold(EntityPlayer player) {
		// List of effects being turned on
		List<Effect> effectsInThreshold = new ArrayList<>();

		// Get player nutrition
		Map<Nutrient, Float> playerNutrition = player.getCapability(NUTRITION_CAPABILITY, null).get();