    001package net.minecraft.client.model;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import net.minecraft.entity.Entity;
    006import net.minecraft.util.MathHelper;
    007
    008@SideOnly(Side.CLIENT)
    009public class ModelWitch extends ModelVillager
    010{
    011    public boolean field_82900_g = false;
    012    private ModelRenderer field_82901_h = (new ModelRenderer(this)).setTextureSize(64, 128);
    013    private ModelRenderer witchHat;
    014
    015    public ModelWitch(float par1)
    016    {
    017        super(par1, 0.0F, 64, 128);
    018        this.field_82901_h.setRotationPoint(0.0F, -2.0F, 0.0F);
    019        this.field_82901_h.setTextureOffset(0, 0).addBox(0.0F, 3.0F, -6.75F, 1, 1, 1, -0.25F);
    020        this.field_82898_f.addChild(this.field_82901_h);
    021        this.witchHat = (new ModelRenderer(this)).setTextureSize(64, 128);
    022        this.witchHat.setRotationPoint(-5.0F, -10.03125F, -5.0F);
    023        this.witchHat.setTextureOffset(0, 64).addBox(0.0F, 0.0F, 0.0F, 10, 2, 10);
    024        this.villagerHead.addChild(this.witchHat);
    025        ModelRenderer modelrenderer = (new ModelRenderer(this)).setTextureSize(64, 128);
    026        modelrenderer.setRotationPoint(1.75F, -4.0F, 2.0F);
    027        modelrenderer.setTextureOffset(0, 76).addBox(0.0F, 0.0F, 0.0F, 7, 4, 7);
    028        modelrenderer.rotateAngleX = -0.05235988F;
    029        modelrenderer.rotateAngleZ = 0.02617994F;
    030        this.witchHat.addChild(modelrenderer);
    031        ModelRenderer modelrenderer1 = (new ModelRenderer(this)).setTextureSize(64, 128);
    032        modelrenderer1.setRotationPoint(1.75F, -4.0F, 2.0F);
    033        modelrenderer1.setTextureOffset(0, 87).addBox(0.0F, 0.0F, 0.0F, 4, 4, 4);
    034        modelrenderer1.rotateAngleX = -0.10471976F;
    035        modelrenderer1.rotateAngleZ = 0.05235988F;
    036        modelrenderer.addChild(modelrenderer1);
    037        ModelRenderer modelrenderer2 = (new ModelRenderer(this)).setTextureSize(64, 128);
    038        modelrenderer2.setRotationPoint(1.75F, -2.0F, 2.0F);
    039        modelrenderer2.setTextureOffset(0, 95).addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.25F);
    040        modelrenderer2.rotateAngleX = -0.20943952F;
    041        modelrenderer2.rotateAngleZ = 0.10471976F;
    042        modelrenderer1.addChild(modelrenderer2);
    043    }
    044
    045    /**
    046     * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
    047     * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
    048     * "far" arms and legs can swing at most.
    049     */
    050    public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity)
    051    {
    052        super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity);
    053        this.field_82898_f.field_82906_o = this.field_82898_f.field_82908_p = this.field_82898_f.field_82907_q = 0.0F;
    054        float f6 = 0.01F * (float)(par7Entity.entityId % 10);
    055        this.field_82898_f.rotateAngleX = MathHelper.sin((float)par7Entity.ticksExisted * f6) * 4.5F * (float)Math.PI / 180.0F;
    056        this.field_82898_f.rotateAngleY = 0.0F;
    057        this.field_82898_f.rotateAngleZ = MathHelper.cos((float)par7Entity.ticksExisted * f6) * 2.5F * (float)Math.PI / 180.0F;
    058
    059        if (this.field_82900_g)
    060        {
    061            this.field_82898_f.rotateAngleX = -0.9F;
    062            this.field_82898_f.field_82907_q = -0.09375F;
    063            this.field_82898_f.field_82908_p = 0.1875F;
    064        }
    065    }
    066
    067    public int func_82899_a()
    068    {
    069        return 0;
    070    }
    071}