package xyz.brassgoggledcoders.steamagerevolution.modules.armory;

import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Biomes;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
import net.minecraftforge.event.entity.living.LivingFallEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.EntityEntry;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import xyz.brassgoggledcoders.steamagerevolution.SteamAgeRevolution;
import xyz.brassgoggledcoders.steamagerevolution.modules.armory.entities.EntityBullet;
import xyz.brassgoggledcoders.steamagerevolution.modules.armory.entities.EntityDeadInventor;
import xyz.brassgoggledcoders.steamagerevolution.modules.armory.items.ItemClockworkWings;

@EventBusSubscriber(modid = SteamAgeRevolution.MODID)
public class EventHandler {
	@SubscribeEvent
	public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
		event.getRegistry().register(
				new RecipeAddLens().setRegistryName(new ResourceLocation(SteamAgeRevolution.MODID, "add_lens")));
	}
	
	//NOTE: Handled in ModuleMetalworking
	//public static void onOreRegistered(OreDictionary.OreRegisterEvent event)

	@SubscribeEvent
	public static void registerEntities(RegistryEvent.Register<EntityEntry> event) {
		int networkID = 0;
		EntityRegistry.registerModEntity(new ResourceLocation(SteamAgeRevolution.MODID, "bullet"), EntityBullet.class,
				"bullet", networkID++, SteamAgeRevolution.MODID, 64, 1, true);
		EntityRegistry.registerModEntity(new ResourceLocation(SteamAgeRevolution.MODID, "dead_inventor"),
				EntityDeadInventor.class, "dead_inventor", networkID++, SteamAgeRevolution.MODID, 64, 1, true, 0,
				11111);
		EntityRegistry.addSpawn(EntityDeadInventor.class, 10, 1, 2, EnumCreatureType.MONSTER, Biomes.DESERT,
				Biomes.ROOFED_FOREST, Biomes.JUNGLE, Biomes.EXTREME_HILLS);// TODO
	}

	//No fall damage while wearing wings
	@SubscribeEvent
	public static void onLivingFall(LivingFallEvent event) { 
		if(event.getEntityLiving() instanceof EntityPlayer) {
			EntityPlayer player = (EntityPlayer) event.getEntityLiving();
			if((player.getFoodStats().getFoodLevel() != 0) && player.inventory.armorInventory.get(2).getItem() == ModuleArmory.wings) {		
				//player.addExhaustion(ItemClockworkWings.hungerPerTick / 4); TODO
				event.setDamageMultiplier(0);	
			}
		}
	}
}

@@ -92,107 +92,27 @@
 ity.
-EnumCreatureType;%0Aimport net.minecraft.entity.player.EntityPlayer;%0Aimport net.minecraft.init.Biomes
+player.EntityPlayer
 ;%0Aim
@@ -248,83 +248,8 @@
 nt;%0A
-import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;%0A
 impo
@@ -445,1583 +445,500 @@
 ort 
-net.minecraftforge.fml.common.registry.EntityEntry;%0Aimport net.minecraftforge.fml.common.registry.EntityRegistry;%0Aimport xyz.brassgoggledcoders.steamagerevolution.SteamAgeRevolution;%0Aimport xyz.brassgoggledcoders.steamagerevolution.modules.armory.entities.EntityBullet;%0Aimport xyz.brassgoggledcoders.steamagerevolution.modules.armory.entities.EntityDeadInventor;%0Aimport xyz.brassgoggledcoders.steamagerevolution.modules.armory.items.ItemClockworkWings;%0A%0A@EventBusSubscriber(modid = SteamAgeRevolution.MODID)%0Apublic class EventHandler %7B%0A%09@SubscribeEvent%0A%09public static void registerRecipes(RegistryEvent.Register%3CIRecipe%3E event) %7B%0A%09%09event.getRegistry().register(%0A%09%09%09%09new RecipeAddLens().setRegistryName(new ResourceLocation(SteamAgeRevolution.MODID, %22add_lens%22)));%0A%09%7D%0A%09%0A%09//NOTE: Handled in ModuleMetalworking%0A%09//public static void onOreRegistered(OreDictionary.OreRegisterEvent event)%0A%0A%09@SubscribeEvent%0A%09public static void registerEntities(RegistryEvent.Register%3CEntityEntry%3E event) %7B%0A%09%09int networkID = 0;%0A%09%09EntityRegistry.registerModEntity(new ResourceLocation(SteamAgeRevolution.MODID, %22bullet%22), EntityBullet.class,%0A%09%09%09%09%22bullet%22, networkID++, SteamAgeRevolution.MODID, 64, 1, true);%0A%09%09EntityRegistry.registerModEntity(new ResourceLocation(SteamAgeRevolution.MODID, %22dead_inventor%22),%0A%09%09%09%09EntityDeadInventor.class, %22dead_inventor%22, networkID++, SteamAgeRevolution.MODID, 64, 1, true, 0,%0A%09%09%09%0911111);%0A%09%09EntityRegistry.addSpawn(EntityDeadInventor.class, 10, 1, 2, EnumCreatureType.MONSTER, Biomes.DESERT,%0A%09%09%09%09Biomes.ROOFED_FOREST, Biomes.JUNGLE, Biomes.EXTREME_HILLS);// TODO%0A%09%7D
+xyz.brassgoggledcoders.steamagerevolution.SteamAgeRevolution;%0A%0A@EventBusSubscriber(modid = SteamAgeRevolution.MODID)%0Apublic class EventHandler %7B%0A%09@SubscribeEvent%0A%09public static void registerRecipes(RegistryEvent.Register%3CIRecipe%3E event) %7B%0A%09%09event.getRegistry().register(%0A%09%09%09%09new RecipeAddLens().setRegistryName(new ResourceLocation(SteamAgeRevolution.MODID, %22add_lens%22)));%0A%09%7D%0A%09%0A%09//NOTE: Handled in ModuleMetalworking%0A%09//public static void onOreRegistered(OreDictionary.OreRegisterEvent event)
 %0A%0A%09/

Fix #46 entity registry was wanged