    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005
    006    @SideOnly(Side.CLIENT)
    007    public class ModelBlaze extends ModelBase
    008    {
    009        private ModelRenderer[] field_78106_a = new ModelRenderer[12];
    010        private ModelRenderer field_78105_b;
    011
    012        public ModelBlaze()
    013        {
    014            for (int var1 = 0; var1 < this.field_78106_a.length; ++var1)
    015            {
    016                this.field_78106_a[var1] = new ModelRenderer(this, 0, 16);
    017                this.field_78106_a[var1].addBox(0.0F, 0.0F, 0.0F, 2, 8, 2);
    018            }
    019
    020            this.field_78105_b = new ModelRenderer(this, 0, 0);
    021            this.field_78105_b.addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8);
    022        }
    023
    024        public int func_78104_a()
    025        {
    026            return 8;
    027        }
    028
    029        /**
    030         * Sets the models various rotation angles then renders the model.
    031         */
    032        public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
    033        {
    034            this.setRotationAngles(par2, par3, par4, par5, par6, par7);
    035            this.field_78105_b.render(par7);
    036            ModelRenderer[] var8 = this.field_78106_a;
    037            int var9 = var8.length;
    038
    039            for (int var10 = 0; var10 < var9; ++var10)
    040            {
    041                ModelRenderer var11 = var8[var10];
    042                var11.render(par7);
    043            }
    044        }
    045
    046        /**
    047         * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
    048         * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
    049         * "far" arms and legs can swing at most.
    050         */
    051        public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6)
    052        {
    053            float var7 = par3 * (float)Math.PI * -0.1F;
    054            int var8;
    055
    056            for (var8 = 0; var8 < 4; ++var8)
    057            {
    058                this.field_78106_a[var8].rotationPointY = -2.0F + MathHelper.cos(((float)(var8 * 2) + par3) * 0.25F);
    059                this.field_78106_a[var8].rotationPointX = MathHelper.cos(var7) * 9.0F;
    060                this.field_78106_a[var8].rotationPointZ = MathHelper.sin(var7) * 9.0F;
    061                ++var7;
    062            }
    063
    064            var7 = ((float)Math.PI / 4F) + par3 * (float)Math.PI * 0.03F;
    065
    066            for (var8 = 4; var8 < 8; ++var8)
    067            {
    068                this.field_78106_a[var8].rotationPointY = 2.0F + MathHelper.cos(((float)(var8 * 2) + par3) * 0.25F);
    069                this.field_78106_a[var8].rotationPointX = MathHelper.cos(var7) * 7.0F;
    070                this.field_78106_a[var8].rotationPointZ = MathHelper.sin(var7) * 7.0F;
    071                ++var7;
    072            }
    073
    074            var7 = 0.47123894F + par3 * (float)Math.PI * -0.05F;
    075
    076            for (var8 = 8; var8 < 12; ++var8)
    077            {
    078                this.field_78106_a[var8].rotationPointY = 11.0F + MathHelper.cos(((float)var8 * 1.5F + par3) * 0.5F);
    079                this.field_78106_a[var8].rotationPointX = MathHelper.cos(var7) * 5.0F;
    080                this.field_78106_a[var8].rotationPointZ = MathHelper.sin(var7) * 5.0F;
    081                ++var7;
    082            }
    083
    084            this.field_78105_b.rotateAngleY = par4 / (180F / (float)Math.PI);
    085            this.field_78105_b.rotateAngleX = par5 / (180F / (float)Math.PI);
    086        }
    087    }