// Path: src/main/java/eureka/api/EurekaAPI.java
// public class EurekaAPI {
// 
// 	public static IEurekAPI API;
// }
// 
// Path: src/main/java/eureka/api/IEurekaInfo.java
// public interface IEurekaInfo {
// 
// 	String getCategory();
// 
// 	int getMaxProgress();
// 
// 	ItemStack getDisplayStack();
// 
// 	String getName();
// 
// 	List<String> getRequiredResearch();
// }
// 
// Path: src/main/java/eureka/networking/MessageResearchFinished.java
// public class MessageResearchFinished implements IMessage, IMessageHandler<MessageResearchFinished, IMessage> {
// 	public String key;
// 
// 	public MessageResearchFinished() {
// 	}
// 
// 	public MessageResearchFinished(String key) {
// 		this.key = key;
// 	}
// 
// 	@Override
// 	public void fromBytes(ByteBuf buf) {
// 		int num = buf.readInt();
// 		key = "";
// 		for (int t = 0; t < num; t++)
// 			key += buf.readChar();
// 		key = key.trim();
// 	}
// 
// 	@Override
// 	public void toBytes(ByteBuf buf) {
// 		buf.writeInt(key.length());
// 		for (char c : key.toCharArray())
// 			buf.writeChar(c);
// 	}
// 
// 	@Override
// 	public IMessage onMessage(MessageResearchFinished message, MessageContext ctx) {
// 		FMLClientHandler.instance().getClient().thePlayer.addChatComponentMessage(new ChatComponentTranslation("EUREKA"));
// 		FMLClientHandler.instance().getClient().thePlayer.addChatComponentMessage(new ChatComponentText("Research finished: " + TextGetter.getTitle(message.key)));
// 		return null;
// 	}
// }
// 
// Path: src/main/java/eureka/networking/PacketHandler.java
// public class PacketHandler {
// 
// 	public static final SimpleNetworkWrapper instance = NetworkRegistry.INSTANCE.newSimpleChannel("eureka");
// 
// 	public static void init() {
// 		instance.registerMessage(MessageResearch.class, MessageResearch.class, 0, Side.CLIENT);
// 		instance.registerMessage(MessageResearchFinished.class, MessageResearchFinished.class, 1, Side.CLIENT);
// 		instance.registerMessage(MessageBookSave.class, MessageBookSave.class, 2, Side.SERVER);
// 	}
// }


import java.util.HashMap;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.IExtendedEntityProperties;
import eureka.api.EurekaAPI;
import eureka.api.IEurekaInfo;
import eureka.networking.MessageResearchFinished;
import eureka.networking.PacketHandler;
package eureka.core;




/**
 * Copyright (c) 2014-2015, AEnterprise
 * http://buildcraftadditions.wordpress.com/
 * Eureka is distributed under the terms of GNU GPL v3.0
 * Please check the contents of the license located in
 * http://buildcraftadditions.wordpress.com/wiki/licensing-stuff/
 */
public class PlayerResearch implements IExtendedEntityProperties {

	private final static String EXT_PROP_NAME = "EurekaPlayerResearch";
	private final EntityPlayer player;
	private HashMap<String, Integer> progressList = new HashMap<String, Integer>();
	private HashMap<String, Boolean> finished = new HashMap<String, Boolean>();

	public PlayerResearch(EntityPlayer player) {
		this.player = player;
	}

	public static void register(EntityPlayer player) {
		player.registerExtendedProperties(EXT_PROP_NAME, new PlayerResearch(player));
	}

	public static PlayerResearch get(EntityPlayer player) {
		if (player == null)
			return null;
		return (PlayerResearch) player.getExtendedProperties(EXT_PROP_NAME);
	}

	@Override
	public void saveNBTData(NBTTagCompound compound) {
		NBTTagCompound tag = new NBTTagCompound();
// Path: src/main/java/eureka/api/EurekaAPI.java
// public class EurekaAPI {
// 
// 	public static IEurekAPI API;
// }
// 
// Path: src/main/java/eureka/api/IEurekaInfo.java
// public interface IEurekaInfo {
// 
// 	String getCategory();
// 
// 	int getMaxProgress();
// 
// 	ItemStack getDisplayStack();
// 
// 	String getName();
// 
// 	List<String> getRequiredResearch();
// }
// 
// Path: src/main/java/eureka/networking/MessageResearchFinished.java
// public class MessageResearchFinished implements IMessage, IMessageHandler<MessageResearchFinished, IMessage> {
// 	public String key;
// 
// 	public MessageResearchFinished() {
// 	}
// 
// 	public MessageResearchFinished(String key) {
// 		this.key = key;
// 	}
// 
// 	@Override
// 	public void fromBytes(ByteBuf buf) {
// 		int num = buf.readInt();
// 		key = "";
// 		for (int t = 0; t < num; t++)
// 			key += buf.readChar();
// 		key = key.trim();
// 	}
// 
// 	@Override
// 	public void toBytes(ByteBuf buf) {
// 		buf.writeInt(key.length());
// 		for (char c : key.toCharArray())
// 			buf.writeChar(c);
// 	}
// 
// 	@Override
// 	public IMessage onMessage(MessageResearchFinished message, MessageContext ctx) {
// 		FMLClientHandler.instance().getClient().thePlayer.addChatComponentMessage(new ChatComponentTranslation("EUREKA"));
// 		FMLClientHandler.instance().getClient().thePlayer.addChatComponentMessage(new ChatComponentText("Research finished: " + TextGetter.getTitle(message.key)));
// 		return null;
// 	}
// }
// 
// Path: src/main/java/eureka/networking/PacketHandler.java
// public class PacketHandler {
// 
// 	public static final SimpleNetworkWrapper instance = NetworkRegistry.INSTANCE.newSimpleChannel("eureka");
// 
// 	public static void init() {
// 		instance.registerMessage(MessageResearch.class, MessageResearch.class, 0, Side.CLIENT);
// 		instance.registerMessage(MessageResearchFinished.class, MessageResearchFinished.class, 1, Side.CLIENT);
// 		instance.registerMessage(MessageBookSave.class, MessageBookSave.class, 2, Side.SERVER);
// 	}
// }


// Path: src/main/java/eureka/core/PlayerResearch.java
import java.util.HashMap;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.IExtendedEntityProperties;
import eureka.api.EurekaAPI;
import eureka.api.IEurekaInfo;
import eureka.networking.MessageResearchFinished;
import eureka.networking.PacketHandler;

package eureka.core;




/**
 * Copyright (c) 2014-2015, AEnterprise
 * http://buildcraftadditions.wordpress.com/
 * Eureka is distributed under the terms of GNU GPL v3.0
 * Please check the contents of the license located in
 * http://buildcraftadditions.wordpress.com/wiki/licensing-stuff/
 */
public class PlayerResearch implements IExtendedEntityProperties {

	private final static String EXT_PROP_NAME = "EurekaPlayerResearch";
	private final EntityPlayer player;
	private HashMap<String, Integer> progressList = new HashMap<String, Integer>();
	private HashMap<String, Boolean> finished = new HashMap<String, Boolean>();

	public PlayerResearch(EntityPlayer player) {
		this.player = player;
	}

	public static void register(EntityPlayer player) {
		player.registerExtendedProperties(EXT_PROP_NAME, new PlayerResearch(player));
	}

	public static PlayerResearch get(EntityPlayer player) {
		if (player == null)
			return null;
		return (PlayerResearch) player.getExtendedProperties(EXT_PROP_NAME);
	}

	@Override
	public void saveNBTData(NBTTagCompound compound) {
		NBTTagCompound tag = new NBTTagCompound();
		for (IEurekaInfo research : EurekaAPI.API.getAllKeys()) {