package client.init;

import java.util.Map;

import client.renderer.entity.Render;
import client.renderer.entity.RenderArachnoid;
import client.renderer.entity.RenderArrow;
import client.renderer.entity.RenderBat;
import client.renderer.entity.RenderBlockEntity;
import client.renderer.entity.RenderBoat;
import client.renderer.entity.RenderBullet;
import client.renderer.entity.RenderCamera;
import client.renderer.entity.RenderChicken;
import client.renderer.entity.RenderCow;
import client.renderer.entity.RenderCrystal;
import client.renderer.entity.RenderDie;
import client.renderer.entity.RenderDragon;
import client.renderer.entity.RenderDynamite;
import client.renderer.entity.RenderEntity;
import client.renderer.entity.RenderEntityItem;
import client.renderer.entity.RenderFallingBlock;
import client.renderer.entity.RenderFireball;
import client.renderer.entity.RenderFish;
import client.renderer.entity.RenderFlyingBox;
import client.renderer.entity.RenderFox;
import client.renderer.entity.RenderHorse;
import client.renderer.entity.RenderHumanoid;
import client.renderer.entity.RenderItem;
import client.renderer.entity.RenderItemEntity;
import client.renderer.entity.RenderLeashKnot;
import client.renderer.entity.RenderLightning;
import client.renderer.entity.RenderManager;
import client.renderer.entity.RenderMinecart;
import client.renderer.entity.RenderMissile;
import client.renderer.entity.RenderMouse;
import client.renderer.entity.RenderNpc;
import client.renderer.entity.RenderCat;
import client.renderer.entity.RenderPig;
import client.renderer.entity.RenderPotion;
import client.renderer.entity.RenderRabbit;
import client.renderer.entity.RenderSheep;
import client.renderer.entity.RenderSlime;
import client.renderer.entity.RenderSpaceMarine;
import client.renderer.entity.RenderTntMinecart;
import client.renderer.entity.RenderTntPrimed;
import client.renderer.entity.RenderWolf;
import client.renderer.entity.RenderXp;
import client.renderer.model.ModelChicken;
import client.renderer.model.ModelCow;
import client.renderer.model.ModelFox;
import client.renderer.model.ModelHorse;
import client.renderer.model.ModelMouse;
import client.renderer.model.ModelCat;
import client.renderer.model.ModelPig;
import client.renderer.model.ModelRabbit;
import client.renderer.model.ModelSheep2;
import client.renderer.model.ModelWolf;
import client.renderer.texture.TextureTicked.TextureCreator;
import client.renderer.ticked.TextureFlame;
import client.renderer.ticked.TextureMagma;
import client.renderer.ticked.TextureMagmaFlow;
import client.renderer.ticked.TextureWater;
import client.renderer.ticked.TextureWaterFlow;
import common.entity.Entity;
import common.entity.animal.EntityBat;
import common.entity.animal.EntityChicken;
import common.entity.animal.EntityCow;
import common.entity.animal.EntityDragon;
import common.entity.animal.EntityFox;
import common.entity.animal.EntityHorse;
import common.entity.animal.EntityMouse;
import common.entity.animal.EntityCat;
import common.entity.animal.EntityPig;
import common.entity.animal.EntityRabbit;
import common.entity.animal.EntitySheep;
import common.entity.animal.EntityWolf;
import common.entity.effect.EntityLightning;
import common.entity.item.EntityBoat;
import common.entity.item.EntityCart;
import common.entity.item.EntityCrystal;
import common.entity.item.EntityFalling;
import common.entity.item.EntityItem;
import common.entity.item.EntityLeashKnot;
import common.entity.item.EntityNuke;
import common.entity.item.EntityOrb;
import common.entity.item.EntityTnt;
import common.entity.item.EntityTntCart;
import common.entity.item.EntityXp;
import common.entity.npc.EntityCameraHolder;
import common.entity.npc.SpeciesInfo;
import common.entity.projectile.EntityArrow;
import common.entity.projectile.EntityBox;
import common.entity.projectile.EntityBullet;
import common.entity.projectile.EntityDie;
import common.entity.projectile.EntityDynamite;
import common.entity.projectile.EntityEgg;
import common.entity.projectile.EntityFireCharge;
import common.entity.projectile.EntityFireball;
import common.entity.projectile.EntityHook;
import common.entity.projectile.EntityMissile;
import common.entity.projectile.EntityPotion;
import common.entity.projectile.EntitySnowball;
import common.init.Blocks;
import common.init.Items;
import common.init.SpeciesRegistry;
import common.init.SpeciesRegistry.ModelType;
import common.model.TextureAnimation;

public abstract class RenderRegistry {
	public static void registerRenderers(Map<Class<? extends Entity>, Render<? extends Entity>> map, 
			Map<ModelType, RenderNpc> models, RenderManager mgr, RenderItem ritem) {
        map.put(EntityPig.class, new RenderPig(mgr, new ModelPig()));
        map.put(EntitySheep.class, new RenderSheep(mgr, new ModelSheep2()));
        map.put(EntityCow.class, new RenderCow(mgr, new ModelCow()));
        map.put(EntityWolf.class, new RenderWolf(mgr, new ModelWolf()));
        map.put(EntityFox.class, new RenderFox(mgr, new ModelFox()));
        map.put(EntityChicken.class, new RenderChicken(mgr, new ModelChicken()));
        map.put(EntityCat.class, new RenderCat(mgr, new ModelCat()));
        map.put(EntityRabbit.class, new RenderRabbit(mgr, new ModelRabbit()));
        map.put(EntityBat.class, new RenderBat(mgr));
        map.put(EntityDragon.class, new RenderDragon(mgr));
        map.put(EntityCrystal.class, new RenderCrystal(mgr));
        map.put(Entity.class, new RenderEntity(mgr));
        map.put(EntityLeashKnot.class, new RenderLeashKnot(mgr));
        map.put(EntityArrow.class, new RenderArrow(mgr));
        map.put(EntitySnowball.class, new RenderItemEntity(mgr, Items.snowball, ritem));
        map.put(EntityOrb.class, new RenderItemEntity(mgr, Items.charged_orb, ritem));
        map.put(EntityEgg.class, new RenderItemEntity(mgr, Items.egg, ritem));
        map.put(EntityPotion.class, new RenderPotion(mgr, ritem));
        map.put(EntityFireball.class, new RenderFireball(mgr, 0.75F));
        map.put(EntityFireCharge.class, new RenderFireball(mgr, 0.5F));
        map.put(EntityBox.class, new RenderFlyingBox(mgr));
        map.put(EntityItem.class, new RenderEntityItem(mgr, ritem));
        map.put(EntityXp.class, new RenderXp(mgr));
        map.put(EntityTnt.class, new RenderTntPrimed(mgr));
        map.put(EntityFalling.class, new RenderFallingBlock(mgr));
        map.put(EntityTntCart.class, new RenderTntMinecart(mgr));
        map.put(EntityCart.class, new RenderMinecart(mgr));
        map.put(EntityBoat.class, new RenderBoat(mgr));
        map.put(EntityHook.class, new RenderFish(mgr));
        map.put(EntityHorse.class, new RenderHorse(mgr, new ModelHorse()));
        map.put(EntityDynamite.class, new RenderDynamite(mgr, ritem));
        map.put(EntityNuke.class, new RenderBlockEntity(mgr, Blocks.nuke.getState()));
        map.put(EntityMouse.class, new RenderMouse(mgr, new ModelMouse()));
        map.put(EntityDie.class, new RenderDie(mgr));
        map.put(EntityBullet.class, new RenderBullet(mgr));
        map.put(EntityMissile.class, new RenderMissile(mgr));
        map.put(EntityLightning.class, new RenderLightning(mgr));
		models.put(ModelType.HUMANOID, new RenderHumanoid(mgr, 12, 12, "textures/npc/knight_1.png"));
		models.put(ModelType.ARACHNOID, new RenderArachnoid(mgr));
		models.put(ModelType.SLIME, new RenderSlime(mgr));
		models.put(ModelType.DWARF, new RenderHumanoid(mgr, 10, 10, "textures/npc/dwarf.png"));
		models.put(ModelType.HALFLING, new RenderHumanoid(mgr, 8, 8, "textures/npc/goblin.png"));
		models.put(ModelType.SPACE_MARINE, new RenderSpaceMarine(mgr));
        map.put(EntityCameraHolder.class, new RenderCamera(mgr));
		for(int z = 0; z < SpeciesRegistry.SPECIMEN.size(); z++) {
			SpeciesInfo info = SpeciesRegistry.SPECIMEN.get(z);
			map.put(info.clazz, models.get(info.renderer));
		}
	}

	public static void registerAnimations(Map<TextureAnimation, TextureCreator> anim) {
		anim.put(TextureAnimation.FLAME_BASE, () -> new TextureFlame(0xffffffff, 0));
		anim.put(TextureAnimation.FLAME_OFFSET, () -> new TextureFlame(0xffffffff, 160));
		anim.put(TextureAnimation.BLACK_FLAME_BASE, () -> new TextureFlame(0xff202020, 0));
		anim.put(TextureAnimation.BLACK_FLAME_OFFSET, () -> new TextureFlame(0xff202020, 160));
		anim.put(TextureAnimation.BLUE_FLAME_BASE, () -> new TextureFlame(0xff4010ff, 0));
		anim.put(TextureAnimation.BLUE_FLAME_OFFSET, () -> new TextureFlame(0xff4010ff, 160));
		anim.put(TextureAnimation.MAGMA_FLOW, () -> new TextureMagmaFlow());
		anim.put(TextureAnimation.MAGMA_STILL, () -> new TextureMagma());
		anim.put(TextureAnimation.WATER_FLOW, () -> new TextureWaterFlow(0xffffffff));
		anim.put(TextureAnimation.WATER_STILL, () -> new TextureWater(0xffffffff));
		anim.put(TextureAnimation.SWAMP_WATER_FLOW, () -> new TextureWaterFlow(0xffe0ffae));
		anim.put(TextureAnimation.SWAMP_WATER_STILL, () -> new TextureWater(0xffe0ffae));
	}
}
