// Path: src/main/java/eureka/Eureka.java
// @Mod(modid = "eureka", name = "Eureka", version = "@MODVERSION@", acceptedMinecraftVersions = "1.7.10")
// public class Eureka {
// 
// 	@Mod.Instance("eureka")
// 	public static Eureka instance;
// 
// 	@SidedProxy(clientSide = "eureka.proxy.ClientProxy", serverSide = "eureka.proxy.ServerProxy")
// 	public static IProxy proxy;
// 	public static ItemEngineeringDiary engineeringDiary;
// 	public static CreativeTabs eureka = new CreativeTabs("Eureka") {
// 
// 		@Override
// 		public Item getTabIconItem() {
// 			return engineeringDiary;
// 		}
// 
// 	};
// 
// 	public static boolean giveBook;
// 
// 	@Mod.EventHandler
// 	public void preInit(FMLPreInitializationEvent event) {
// 		EurekaAPI.API = new EurekaAPIImplementation();
// 		engineeringDiary = new ItemEngineeringDiary();
// 		GameRegistry.registerItem(engineeringDiary, "engineeringDiary");
// 		GameRegistry.addShapelessRecipe(new ItemStack(engineeringDiary), new Object[]{Items.book, Items.iron_ingot});
// 		MinecraftForge.EVENT_BUS.register(new EventHandler());
// 		FMLCommonHandler.instance().bus().register(new EventHandler());
// 		NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
// 		EurekaAPI.API.registerCategory(new BasicEurekaCategory("Eureka", new ItemStack(engineeringDiary)));
// 		PacketHandler.init();
// 		ConfigReader.mainfolder = new File(event.getModConfigurationDirectory(), "Eureka");
// 		ConfigReader.read();
// 		Configuration config = new Configuration(event.getSuggestedConfigurationFile());
// 		giveBook = config.get("General", "giveBook", true).setDefaultValue(true).getBoolean();
// 		config.save();
// 	}
// 
// 	@Mod.EventHandler
// 	public void serverStart(FMLServerStartingEvent event) {
// 		event.registerServerCommand(new EurekaCommand());
// 	}
// 
// }
// 
// Path: src/main/java/eureka/api/EnumProgressOptions.java
// public enum EnumProgressOptions {
// 	CRAFTING(true),
// 	CRAFT_ANYTHING(false),
// 	BREAK_BLOCK(true),
// 	BREAK_ANY_BLOCK(false),
// 	PLACE_BLOCK(true),
// 	PLACE_ANY_BLOCK(false),
// 	ENDER_TELEPORT(false),
// 	KILL_ANYTHING(false),
// 	DIE(false),
// 	FILL_BUCKET(false);
// 
// 	private final boolean hasArg;
// 
// 	EnumProgressOptions(boolean hasArg) {
// 		this.hasArg = hasArg;
// 	}
// 
// 	public boolean hasArg() {
// 		return hasArg;
// 	}
// }
// 
// Path: src/main/java/eureka/api/EurekaAPI.java
// public class EurekaAPI {
// 
// 	public static IEurekAPI API;
// }


import java.util.List;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.event.entity.EntityEvent;
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.world.BlockEvent;
import eureka.Eureka;
import eureka.api.EnumProgressOptions;
import eureka.api.EurekaAPI;
	}

	@SubscribeEvent(priority = EventPriority.HIGHEST)
	//make sure it gets trigered first to prevent handeling from other mods
	public void onPlayerUsesBlock(PlayerInteractEvent event) {
		String key = "";
		if (event.world.isRemote)
			return;
		EntityPlayer player = event.entityPlayer;
		PlayerResearch research = PlayerResearch.get(player);
		if (player.getCurrentEquippedItem() != null)
			key = EurekaAPI.API.getKey(player.getCurrentEquippedItem());
		if (!research.isFinished(key) && !key.equals("")) {
			ItemStack stack = player.getCurrentEquippedItem().copy();
			stack.stackSize = 1;
			dropItems(event.world, event.x, event.y, event.z, EurekaAPI.API.getDrops(stack));
			if (event.entityPlayer.getCurrentEquippedItem().stackSize > 1)
				event.entityPlayer.getCurrentEquippedItem().stackSize--;
			else
				event.entityPlayer.destroyCurrentEquippedItem();
			event.setCanceled(true);
		}

		key = EurekaAPI.API.getKey(event.world.getBlock(event.x, event.y, event.z));
		if (key != null && !key.equals("") && !research.isFinished(key))
			event.setCanceled(true);
	}

	@SubscribeEvent
	public void bucketFill(FillBucketEvent event) {
// Path: src/main/java/eureka/Eureka.java
// @Mod(modid = "eureka", name = "Eureka", version = "@MODVERSION@", acceptedMinecraftVersions = "1.7.10")
// public class Eureka {
// 
// 	@Mod.Instance("eureka")
// 	public static Eureka instance;
// 
// 	@SidedProxy(clientSide = "eureka.proxy.ClientProxy", serverSide = "eureka.proxy.ServerProxy")
// 	public static IProxy proxy;
// 	public static ItemEngineeringDiary engineeringDiary;
// 	public static CreativeTabs eureka = new CreativeTabs("Eureka") {
// 
// 		@Override
// 		public Item getTabIconItem() {
// 			return engineeringDiary;
// 		}
// 
// 	};
// 
// 	public static boolean giveBook;
// 
// 	@Mod.EventHandler
// 	public void preInit(FMLPreInitializationEvent event) {
// 		EurekaAPI.API = new EurekaAPIImplementation();
// 		engineeringDiary = new ItemEngineeringDiary();
// 		GameRegistry.registerItem(engineeringDiary, "engineeringDiary");
// 		GameRegistry.addShapelessRecipe(new ItemStack(engineeringDiary), new Object[]{Items.book, Items.iron_ingot});
// 		MinecraftForge.EVENT_BUS.register(new EventHandler());
// 		FMLCommonHandler.instance().bus().register(new EventHandler());
// 		NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
// 		EurekaAPI.API.registerCategory(new BasicEurekaCategory("Eureka", new ItemStack(engineeringDiary)));
// 		PacketHandler.init();
// 		ConfigReader.mainfolder = new File(event.getModConfigurationDirectory(), "Eureka");
// 		ConfigReader.read();
// 		Configuration config = new Configuration(event.getSuggestedConfigurationFile());
// 		giveBook = config.get("General", "giveBook", true).setDefaultValue(true).getBoolean();
// 		config.save();
// 	}
// 
// 	@Mod.EventHandler
// 	public void serverStart(FMLServerStartingEvent event) {
// 		event.registerServerCommand(new EurekaCommand());
// 	}
// 
// }
// 
// Path: src/main/java/eureka/api/EnumProgressOptions.java
// public enum EnumProgressOptions {
// 	CRAFTING(true),
// 	CRAFT_ANYTHING(false),
// 	BREAK_BLOCK(true),
// 	BREAK_ANY_BLOCK(false),
// 	PLACE_BLOCK(true),
// 	PLACE_ANY_BLOCK(false),
// 	ENDER_TELEPORT(false),
// 	KILL_ANYTHING(false),
// 	DIE(false),
// 	FILL_BUCKET(false);
// 
// 	private final boolean hasArg;
// 
// 	EnumProgressOptions(boolean hasArg) {
// 		this.hasArg = hasArg;
// 	}
// 
// 	public boolean hasArg() {
// 		return hasArg;
// 	}
// }
// 
// Path: src/main/java/eureka/api/EurekaAPI.java
// public class EurekaAPI {
// 
// 	public static IEurekAPI API;
// }


// Path: src/main/java/eureka/core/EventHandler.java
import java.util.List;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.event.entity.EntityEvent;
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.world.BlockEvent;
import eureka.Eureka;
import eureka.api.EnumProgressOptions;
import eureka.api.EurekaAPI;

	}

	@SubscribeEvent(priority = EventPriority.HIGHEST)
	//make sure it gets trigered first to prevent handeling from other mods
	public void onPlayerUsesBlock(PlayerInteractEvent event) {
		String key = "";
		if (event.world.isRemote)
			return;
		EntityPlayer player = event.entityPlayer;
		PlayerResearch research = PlayerResearch.get(player);
		if (player.getCurrentEquippedItem() != null)
			key = EurekaAPI.API.getKey(player.getCurrentEquippedItem());
		if (!research.isFinished(key) && !key.equals("")) {
			ItemStack stack = player.getCurrentEquippedItem().copy();
			stack.stackSize = 1;
			dropItems(event.world, event.x, event.y, event.z, EurekaAPI.API.getDrops(stack));
			if (event.entityPlayer.getCurrentEquippedItem().stackSize > 1)
				event.entityPlayer.getCurrentEquippedItem().stackSize--;
			else
				event.entityPlayer.destroyCurrentEquippedItem();
			event.setCanceled(true);
		}

		key = EurekaAPI.API.getKey(event.world.getBlock(event.x, event.y, event.z));
		if (key != null && !key.equals("") && !research.isFinished(key))
			event.setCanceled(true);
	}

	@SubscribeEvent
	public void bucketFill(FillBucketEvent event) {
		makeProgress(EnumProgressOptions.FILL_BUCKET, PlayerResearch.get(event.entityPlayer), null);