// 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/gui/ModGuiHandler.java
// public class ModGuiHandler implements IGuiHandler {
// 	// GUI IDs
// 	public static final int NUTRITION_GUI_ID = 0;
// 	public static NutritionGui nutritionGui;
// 
// 	@Override
// 	public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
// 		return null;
// 	}
// 
// 	@Override
// 	public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
// 		if (ID == NUTRITION_GUI_ID)
// 			return nutritionGui = new NutritionGui();
// 		return null;
// 	}
// }
// 
// 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/nutrients/NutrientList.java
// public class NutrientList {
// 	private static List<Nutrient> nutrients = new ArrayList<>();
// 
// 	// Register list of JSON objects
// 	public static void register(List<Nutrient> nutrientsIn) {
// 		nutrients.clear();
// 		nutrients.addAll(nutrientsIn);
// 	}
// 
// 	// Return all nutrients
// 	public static List<Nutrient> get() {
// 		return nutrients;
// 	}
// 
// 	// Return all visible nutrients
// 	public static List<Nutrient> getVisible() {
// 		List<Nutrient> visibleNutrients = new ArrayList<>();
// 		for (Nutrient nutrient : nutrients)
// 			if (nutrient.visible)
// 				visibleNutrients.add(nutrient);
// 		return visibleNutrients;
// 	}
// 
// 	// Return nutrient by name (null if not found)
// 	public static Nutrient getByName(String name) {
// 		for (Nutrient nutrient : nutrients) {
// 			if (nutrient.name.equals(name))
// 				return nutrient;
// 		}
// 		return null;
// 	}
// }
// 
// Path: src/main/java/ca/wescook/nutrition/proxy/ClientProxy.java
// public class ClientProxy implements IProxy {
// 	public static INutrientManager localNutrition; // Holds local copy of data/methods for client-side prediction
// 	public static KeyBinding keyNutritionGui;
// 
// 	@Override
// 	public void preInit(FMLPreInitializationEvent event) {
// 	}
// 
// 	@Override
// 	public void init(FMLInitializationEvent event) {
// 
// 		if (Config.enableGui) { // If GUI is enabled
// 			ClientRegistry.registerKeyBinding(keyNutritionGui = new KeyBinding("key.nutrition", 49, "Nutrition")); // Register Nutrition keybind, default to "N"
// 			MinecraftForge.EVENT_BUS.register(new EventNutritionKey()); // Register key input event to respond to keybind
// 			if (Config.enableGuiButton)
// 				MinecraftForge.EVENT_BUS.register(new EventNutritionButton()); // Register GUI button event
// 		}
// 
// 		if (Config.enableTooltips)
// 			MinecraftForge.EVENT_BUS.register(new EventTooltip()); // Register tooltip event
// 	}
// 
// 	@Override
// 	public void postInit(FMLPostInitializationEvent event) {
// 	}
// }


import ca.wescook.nutrition.capabilities.INutrientManager;
import ca.wescook.nutrition.gui.ModGuiHandler;
import ca.wescook.nutrition.nutrients.Nutrient;
import ca.wescook.nutrition.nutrients.NutrientList;
import ca.wescook.nutrition.proxy.ClientProxy;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import java.util.HashMap;
import java.util.Map;
package ca.wescook.nutrition.network;



public class PacketNutritionResponse {
	// Message Subclass
	public static class Message implements IMessage {
		@CapabilityInject(INutrientManager.class)
		private static final Capability<INutrientManager> NUTRITION_CAPABILITY = null;

		// Server vars only
		EntityPlayer serverPlayer;

		// Client vars only
		Map<Nutrient, Float> clientNutrients;

		public Message() {}

		// Message data is passed along from server
		public Message(EntityPlayer player) {
			serverPlayer = player; // Get server player
		}

		// Then serialized into bytes (on server)
		@Override
		public void toBytes(ByteBuf buf) {
			// Loop through nutrients from server player, and add to buffer
			Map<Nutrient, Float> nutrientData = serverPlayer.getCapability(NUTRITION_CAPABILITY, null).get();
// 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/gui/ModGuiHandler.java
// public class ModGuiHandler implements IGuiHandler {
// 	// GUI IDs
// 	public static final int NUTRITION_GUI_ID = 0;
// 	public static NutritionGui nutritionGui;
// 
// 	@Override
// 	public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
// 		return null;
// 	}
// 
// 	@Override
// 	public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
// 		if (ID == NUTRITION_GUI_ID)
// 			return nutritionGui = new NutritionGui();
// 		return null;
// 	}
// }
// 
// 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/nutrients/NutrientList.java
// public class NutrientList {
// 	private static List<Nutrient> nutrients = new ArrayList<>();
// 
// 	// Register list of JSON objects
// 	public static void register(List<Nutrient> nutrientsIn) {
// 		nutrients.clear();
// 		nutrients.addAll(nutrientsIn);
// 	}
// 
// 	// Return all nutrients
// 	public static List<Nutrient> get() {
// 		return nutrients;
// 	}
// 
// 	// Return all visible nutrients
// 	public static List<Nutrient> getVisible() {
// 		List<Nutrient> visibleNutrients = new ArrayList<>();
// 		for (Nutrient nutrient : nutrients)
// 			if (nutrient.visible)
// 				visibleNutrients.add(nutrient);
// 		return visibleNutrients;
// 	}
// 
// 	// Return nutrient by name (null if not found)
// 	public static Nutrient getByName(String name) {
// 		for (Nutrient nutrient : nutrients) {
// 			if (nutrient.name.equals(name))
// 				return nutrient;
// 		}
// 		return null;
// 	}
// }
// 
// Path: src/main/java/ca/wescook/nutrition/proxy/ClientProxy.java
// public class ClientProxy implements IProxy {
// 	public static INutrientManager localNutrition; // Holds local copy of data/methods for client-side prediction
// 	public static KeyBinding keyNutritionGui;
// 
// 	@Override
// 	public void preInit(FMLPreInitializationEvent event) {
// 	}
// 
// 	@Override
// 	public void init(FMLInitializationEvent event) {
// 
// 		if (Config.enableGui) { // If GUI is enabled
// 			ClientRegistry.registerKeyBinding(keyNutritionGui = new KeyBinding("key.nutrition", 49, "Nutrition")); // Register Nutrition keybind, default to "N"
// 			MinecraftForge.EVENT_BUS.register(new EventNutritionKey()); // Register key input event to respond to keybind
// 			if (Config.enableGuiButton)
// 				MinecraftForge.EVENT_BUS.register(new EventNutritionButton()); // Register GUI button event
// 		}
// 
// 		if (Config.enableTooltips)
// 			MinecraftForge.EVENT_BUS.register(new EventTooltip()); // Register tooltip event
// 	}
// 
// 	@Override
// 	public void postInit(FMLPostInitializationEvent event) {
// 	}
// }


// Path: src/main/java/ca/wescook/nutrition/network/PacketNutritionResponse.java
import ca.wescook.nutrition.capabilities.INutrientManager;
import ca.wescook.nutrition.gui.ModGuiHandler;
import ca.wescook.nutrition.nutrients.Nutrient;
import ca.wescook.nutrition.nutrients.NutrientList;
import ca.wescook.nutrition.proxy.ClientProxy;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import java.util.HashMap;
import java.util.Map;

package ca.wescook.nutrition.network;



public class PacketNutritionResponse {
	// Message Subclass
	public static class Message implements IMessage {
		@CapabilityInject(INutrientManager.class)
		private static final Capability<INutrientManager> NUTRITION_CAPABILITY = null;

		// Server vars only
		EntityPlayer serverPlayer;

		// Client vars only
		Map<Nutrient, Float> clientNutrients;

		public Message() {}

		// Message data is passed along from server
		public Message(EntityPlayer player) {
			serverPlayer = player; // Get server player
		}

		// Then serialized into bytes (on server)
		@Override
		public void toBytes(ByteBuf buf) {
			// Loop through nutrients from server player, and add to buffer
			Map<Nutrient, Float> nutrientData = serverPlayer.getCapability(NUTRITION_CAPABILITY, null).get();
			for (Map.Entry<Nutrient, Float> entry : nutrientData.entrySet()) {