// Path: src/main/java/eureka/api/EurekaAPI.java
// public class EurekaAPI {
// 
// 	public static IEurekAPI API;
// }
// 
// Path: src/main/java/eureka/json/ConfigReader.java
// public class ConfigReader {
// 	public static File mainfolder, catagoryFolder, keyFolder, localizations;
// 	private static Gson gson = new GsonBuilder().setPrettyPrinting().create();
// 
// 	public static void read() {
// 		createFolderIfNeeded(mainfolder);
// 		if (!mainfolder.exists())
// 			return;
// 		catagoryFolder = new File(mainfolder, "Categories");
// 		keyFolder = new File(mainfolder, "Keys");
// 		localizations = new File(mainfolder, "Localizations");
// 		createFolderIfNeeded(catagoryFolder);
// 		createFolderIfNeeded(keyFolder);
// 		createFolderIfNeeded(localizations);
// 		createFolderIfNeeded(new File(localizations, "en_US"));
// 
// 		if (!catagoryFolder.exists())
// 			return;
// 
// 		for (File file : catagoryFolder.listFiles(new FilenameFilter() {
// 			@Override
// 			public boolean accept(File dir, String name) {
// 				return name.endsWith(".json");
// 			}
// 		})) {
// 			readCategory(file);
// 		}
// 		if (!keyFolder.exists())
// 			return;
// 		for (File file : keyFolder.listFiles(new FilenameFilter() {
// 			@Override
// 			public boolean accept(File dir, String name) {
// 				return name.endsWith(".json");
// 			}
// 		})) {
// 			readKey(file);
// 		}
// 	}
// 
// 	private static void readCategory(File file) {
// 		try {
// 			JSONCategory category = gson.fromJson(new FileReader(file), JSONCategory.class);
// 			EurekaAPI.API.registerCategory(new BasicEurekaCategory(category.name, getStack(category.displayStack)));
// 		} catch (Throwable t) {
// 			Logger.error("Failed to read category file (" + file.getName() + ")");
// 		}
// 	}
// 
// 	private static void readKey(File file) {
// 		try {
// 			JSONChapter chapter = gson.fromJson(new FileReader(file), JSONChapter.class);
// 			List<ItemStack> objects = new ArrayList<ItemStack>();
// 			for (String stack : chapter.blockedObjects)
// 				objects.add(getStack(stack));
// 			EurekaAPI.API.register(new BasicEurekaInfo(chapter.name, chapter.category, chapter.maxProgress, getStack(chapter.displayStack), chapter.requiredResearch.toArray(new String[100])));
// 			for (ItemStack stack : objects) {
// 				EurekaAPI.API.bindToKey(stack, chapter.name);
// 			}
// 			if (chapter.progressOption != null) {
// 				Object obj;
// 				ItemStack stack = getStack(chapter.progressObject);
// 				if (stack != null && stack.getItem() instanceof ItemBlock)
// 					obj = ((ItemBlock) stack.getItem()).field_150939_a;
// 				else
// 					obj = stack;
// 				EurekaAPI.API.registerProgressOption(chapter.name, chapter.progressOption, obj);
// 			}
// 		} catch (Throwable t) {
// 			Logger.error("Failed to read category file (" + file.getName() + ")");
// 			t.printStackTrace();
// 		}
// 	}
// 
// 	private static ItemStack getStack(String name) {
// 		if (Strings.isNullOrEmpty(name))
// 			return null;
// 		int meta = -1;
// 		if (name.contains("@")) {
// 			meta = Integer.getInteger(name.split("@")[1]);
// 		}
// 		String split[] = name.split(":");
// 		ItemStack stack = GameRegistry.findItemStack(split[0], split[1], 1);
// 		if (meta != -1 && stack != null)
// 			stack.setItemDamage(meta);
// 		return stack;
// 	}
// 
// 	private static void createFolderIfNeeded(File folder) {
// 		try {
// 			if (!Files.exists(folder.toPath()))
// 				Files.createDirectory(folder.toPath());
// 		} catch (Throwable e) {
// 			Logger.error("Something went wrong while checking or creating the Eureka folders");
// 			e.printStackTrace();
// 		}
// 	}
// }


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import net.minecraft.client.resources.IResource;
import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import eureka.api.EurekaAPI;
import eureka.json.ConfigReader;
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 TextGetter {
	private static HashMap<String, String> titles = new HashMap<String, String>();
	private static HashMap<String, String> descriptions = new HashMap<String, String>();
	private static HashMap<String, List<String>> texts = new HashMap<String, List<String>>();
	private static HashMap<String, String> progressTexts = new HashMap<String, String>();

	public static String getTitle(String key) {
		if (FMLCommonHandler.instance().getSide() == Side.SERVER)
			return "Unable to localize on the server side";
		if (titles.containsKey(key))
			return titles.get(key);
		getText(key);
		if (titles.containsKey(key))
			return titles.get(key);
		return "ERROR, UNABLE TO FIND LOCALIZATION FILE";
	}

	public static String getDesc(String key) {
// Path: src/main/java/eureka/api/EurekaAPI.java
// public class EurekaAPI {
// 
// 	public static IEurekAPI API;
// }
// 
// Path: src/main/java/eureka/json/ConfigReader.java
// public class ConfigReader {
// 	public static File mainfolder, catagoryFolder, keyFolder, localizations;
// 	private static Gson gson = new GsonBuilder().setPrettyPrinting().create();
// 
// 	public static void read() {
// 		createFolderIfNeeded(mainfolder);
// 		if (!mainfolder.exists())
// 			return;
// 		catagoryFolder = new File(mainfolder, "Categories");
// 		keyFolder = new File(mainfolder, "Keys");
// 		localizations = new File(mainfolder, "Localizations");
// 		createFolderIfNeeded(catagoryFolder);
// 		createFolderIfNeeded(keyFolder);
// 		createFolderIfNeeded(localizations);
// 		createFolderIfNeeded(new File(localizations, "en_US"));
// 
// 		if (!catagoryFolder.exists())
// 			return;
// 
// 		for (File file : catagoryFolder.listFiles(new FilenameFilter() {
// 			@Override
// 			public boolean accept(File dir, String name) {
// 				return name.endsWith(".json");
// 			}
// 		})) {
// 			readCategory(file);
// 		}
// 		if (!keyFolder.exists())
// 			return;
// 		for (File file : keyFolder.listFiles(new FilenameFilter() {
// 			@Override
// 			public boolean accept(File dir, String name) {
// 				return name.endsWith(".json");
// 			}
// 		})) {
// 			readKey(file);
// 		}
// 	}
// 
// 	private static void readCategory(File file) {
// 		try {
// 			JSONCategory category = gson.fromJson(new FileReader(file), JSONCategory.class);
// 			EurekaAPI.API.registerCategory(new BasicEurekaCategory(category.name, getStack(category.displayStack)));
// 		} catch (Throwable t) {
// 			Logger.error("Failed to read category file (" + file.getName() + ")");
// 		}
// 	}
// 
// 	private static void readKey(File file) {
// 		try {
// 			JSONChapter chapter = gson.fromJson(new FileReader(file), JSONChapter.class);
// 			List<ItemStack> objects = new ArrayList<ItemStack>();
// 			for (String stack : chapter.blockedObjects)
// 				objects.add(getStack(stack));
// 			EurekaAPI.API.register(new BasicEurekaInfo(chapter.name, chapter.category, chapter.maxProgress, getStack(chapter.displayStack), chapter.requiredResearch.toArray(new String[100])));
// 			for (ItemStack stack : objects) {
// 				EurekaAPI.API.bindToKey(stack, chapter.name);
// 			}
// 			if (chapter.progressOption != null) {
// 				Object obj;
// 				ItemStack stack = getStack(chapter.progressObject);
// 				if (stack != null && stack.getItem() instanceof ItemBlock)
// 					obj = ((ItemBlock) stack.getItem()).field_150939_a;
// 				else
// 					obj = stack;
// 				EurekaAPI.API.registerProgressOption(chapter.name, chapter.progressOption, obj);
// 			}
// 		} catch (Throwable t) {
// 			Logger.error("Failed to read category file (" + file.getName() + ")");
// 			t.printStackTrace();
// 		}
// 	}
// 
// 	private static ItemStack getStack(String name) {
// 		if (Strings.isNullOrEmpty(name))
// 			return null;
// 		int meta = -1;
// 		if (name.contains("@")) {
// 			meta = Integer.getInteger(name.split("@")[1]);
// 		}
// 		String split[] = name.split(":");
// 		ItemStack stack = GameRegistry.findItemStack(split[0], split[1], 1);
// 		if (meta != -1 && stack != null)
// 			stack.setItemDamage(meta);
// 		return stack;
// 	}
// 
// 	private static void createFolderIfNeeded(File folder) {
// 		try {
// 			if (!Files.exists(folder.toPath()))
// 				Files.createDirectory(folder.toPath());
// 		} catch (Throwable e) {
// 			Logger.error("Something went wrong while checking or creating the Eureka folders");
// 			e.printStackTrace();
// 		}
// 	}
// }


// Path: src/main/java/eureka/core/TextGetter.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import net.minecraft.client.resources.IResource;
import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import eureka.api.EurekaAPI;
import eureka.json.ConfigReader;

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 TextGetter {
	private static HashMap<String, String> titles = new HashMap<String, String>();
	private static HashMap<String, String> descriptions = new HashMap<String, String>();
	private static HashMap<String, List<String>> texts = new HashMap<String, List<String>>();
	private static HashMap<String, String> progressTexts = new HashMap<String, String>();

	public static String getTitle(String key) {
		if (FMLCommonHandler.instance().getSide() == Side.SERVER)
			return "Unable to localize on the server side";
		if (titles.containsKey(key))
			return titles.get(key);
		getText(key);
		if (titles.containsKey(key))
			return titles.get(key);
		return "ERROR, UNABLE TO FIND LOCALIZATION FILE";
	}

	public static String getDesc(String key) {
		if (!EurekaAPI.API.keyRegistered(key))