package net.minecraft.client.renderer.entity;

import cpw.mods.fml.common.registry.VillagerRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelVillager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;

@SideOnly(Side.CLIENT)
public class RenderVillager extends RenderLiving
{
	private static final ResourceLocation villagerTextures = new ResourceLocation("textures/entity/villager/villager.png");
	private static final ResourceLocation farmerVillagerTextures = new ResourceLocation("textures/entity/villager/farmer.png");
	private static final ResourceLocation librarianVillagerTextures = new ResourceLocation("textures/entity/villager/librarian.png");
	private static final ResourceLocation priestVillagerTextures = new ResourceLocation("textures/entity/villager/priest.png");
	private static final ResourceLocation smithVillagerTextures = new ResourceLocation("textures/entity/villager/smith.png");
	private static final ResourceLocation butcherVillagerTextures = new ResourceLocation("textures/entity/villager/butcher.png");
	protected ModelVillager villagerModel;
	private static final String __OBFID = "CL_00001032";

	public RenderVillager()
	{
		super(new ModelVillager(0.0F), 0.5F);
		this.villagerModel = (ModelVillager)this.mainModel;
	}

	protected int shouldRenderPass(EntityVillager par1EntityVillager, int par2, float par3)
	{
		return -1;
	}

	public void doRender(EntityVillager par1EntityVillager, double par2, double par4, double par6, float par8, float par9)
	{
		super.doRender((EntityLiving)par1EntityVillager, par2, par4, par6, par8, par9);
	}

	protected ResourceLocation getEntityTexture(EntityVillager par1EntityVillager)
	{
		switch (par1EntityVillager.getProfession())
		{
			case 0:
				return farmerVillagerTextures;
			case 1:
				return librarianVillagerTextures;
			case 2:
				return priestVillagerTextures;
			case 3:
				return smithVillagerTextures;
			case 4:
				return butcherVillagerTextures;
			default:
				return VillagerRegistry.getVillagerSkin(par1EntityVillager.getProfession(), villagerTextures);
		}
	}

	protected void renderEquippedItems(EntityVillager par1EntityVillager, float par2)
	{
		super.renderEquippedItems(par1EntityVillager, par2);
	}

	protected void preRenderCallback(EntityVillager par1EntityVillager, float par2)
	{
		float f1 = 0.9375F;

		if (par1EntityVillager.getGrowingAge() < 0)
		{
			f1 = (float)((double)f1 * 0.5D);
			this.shadowSize = 0.25F;
		}
		else
		{
			this.shadowSize = 0.5F;
		}

		GL11.glScalef(f1, f1, f1);
	}

	public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9)
	{
		this.doRender((EntityVillager)par1EntityLiving, par2, par4, par6, par8, par9);
	}

	protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2)
	{
		this.preRenderCallback((EntityVillager)par1EntityLivingBase, par2);
	}

	protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3)
	{
		return this.shouldRenderPass((EntityVillager)par1EntityLivingBase, par2, par3);
	}

	protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2)
	{
		this.renderEquippedItems((EntityVillager)par1EntityLivingBase, par2);
	}

	public void doRender(EntityLivingBase par1Entity, double par2, double par4, double par6, float par8, float par9)
	{
		this.doRender((EntityVillager)par1Entity, par2, par4, par6, par8, par9);
	}

	protected ResourceLocation getEntityTexture(Entity par1Entity)
	{
		return this.getEntityTexture((EntityVillager)par1Entity);
	}

	public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
	{
		this.doRender((EntityVillager)par1Entity, par2, par4, par6, par8, par9);
	}
}