package net.minecraft.client.renderer.entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.model.ModelWitch;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityWitch;
import net.minecraft.init.Items;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderWitch extends RenderLiving
{
private static final ResourceLocation witchTextures = new ResourceLocation("textures/entity/witch.png");
private final ModelWitch witchModel;
private static final String __OBFID = "CL_00001033";
public RenderWitch()
{
super(new ModelWitch(0.0F), 0.5F);
this.witchModel = (ModelWitch)this.mainModel;
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityWitch p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
ItemStack itemstack = p_76986_1_.getHeldItem();
this.witchModel.field_82900_g = itemstack != null;
super.doRender((EntityLiving)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityWitch p_110775_1_)
{
return witchTextures;
}
protected void renderEquippedItems(EntityWitch p_77029_1_, float p_77029_2_)
{
GL11.glColor3f(1.0F, 1.0F, 1.0F);
super.renderEquippedItems(p_77029_1_, p_77029_2_);
ItemStack itemstack = p_77029_1_.getHeldItem();
if (itemstack != null)
{
GL11.glPushMatrix();
float f1;
if (this.mainModel.isChild)
{
f1 = 0.5F;
GL11.glTranslatef(0.0F, 0.625F, 0.0F);
GL11.glRotatef(-20.0F, -1.0F, 0.0F, 0.0F);
GL11.glScalef(f1, f1, f1);
}
this.witchModel.villagerNose.postRender(0.0625F);
GL11.glTranslatef(-0.0625F, 0.53125F, 0.21875F);
if (itemstack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType()))
{
f1 = 0.5F;
GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
f1 *= 0.75F;
GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
GL11.glScalef(f1, -f1, f1);
}
else if (itemstack.getItem() == Items.bow)
{
f1 = 0.625F;
GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
GL11.glScalef(f1, -f1, f1);
GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
}
else if (itemstack.getItem().isFull3D())
{
f1 = 0.625F;
if (itemstack.getItem().shouldRotateAroundWhenRendering())
{
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.0F, -0.125F, 0.0F);
}
this.func_82410_b();
GL11.glScalef(f1, -f1, f1);
GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
}
else
{
f1 = 0.375F;
GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
GL11.glScalef(f1, f1, f1);
GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F);
}
GL11.glRotatef(-15.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(40.0F, 0.0F, 0.0F, 1.0F);
this.renderManager.itemRenderer.renderItem(p_77029_1_, itemstack, 0);
if (itemstack.getItem().requiresMultipleRenderPasses())
{
this.renderManager.itemRenderer.renderItem(p_77029_1_, itemstack, 1);
}
GL11.glPopMatrix();
}
}
protected void func_82410_b()
{
GL11.glTranslatef(0.0F, 0.1875F, 0.0F);
}
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
protected void preRenderCallback(EntityWitch p_77041_1_, float p_77041_2_)
{
float f1 = 0.9375F;
GL11.glScalef(f1, f1, f1);
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
this.doRender((EntityWitch)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_)
{
this.preRenderCallback((EntityWitch)p_77041_1_, p_77041_2_);
}
protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_)
{
this.renderEquippedItems((EntityWitch)p_77029_1_, p_77029_2_);
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
this.doRender((EntityWitch)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
{
return this.getEntityTexture((EntityWitch)p_110775_1_);
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
this.doRender((EntityWitch)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
}