    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 ModelMagmaCube extends ModelBase
    008    {
    009        ModelRenderer[] field_78109_a = new ModelRenderer[8];
    010        ModelRenderer field_78108_b;
    011
    012        public ModelMagmaCube()
    013        {
    014            for (int var1 = 0; var1 < this.field_78109_a.length; ++var1)
    015            {
    016                byte var2 = 0;
    017                int var3 = var1;
    018
    019                if (var1 == 2)
    020                {
    021                    var2 = 24;
    022                    var3 = 10;
    023                }
    024                else if (var1 == 3)
    025                {
    026                    var2 = 24;
    027                    var3 = 19;
    028                }
    029
    030                this.field_78109_a[var1] = new ModelRenderer(this, var2, var3);
    031                this.field_78109_a[var1].addBox(-4.0F, (float)(16 + var1), -4.0F, 8, 1, 8);
    032            }
    033
    034            this.field_78108_b = new ModelRenderer(this, 0, 16);
    035            this.field_78108_b.addBox(-2.0F, 18.0F, -2.0F, 4, 4, 4);
    036        }
    037
    038        public int func_78107_a()
    039        {
    040            return 5;
    041        }
    042
    043        /**
    044         * Used for easily adding entity-dependent animations. The second and third float params here are the same second
    045         * and third as in the setRotationAngles method.
    046         */
    047        public void setLivingAnimations(EntityLiving par1EntityLiving, float par2, float par3, float par4)
    048        {
    049            EntityMagmaCube var5 = (EntityMagmaCube)par1EntityLiving;
    050            float var6 = var5.field_70812_c + (var5.field_70811_b - var5.field_70812_c) * par4;
    051
    052            if (var6 < 0.0F)
    053            {
    054                var6 = 0.0F;
    055            }
    056
    057            for (int var7 = 0; var7 < this.field_78109_a.length; ++var7)
    058            {
    059                this.field_78109_a[var7].rotationPointY = (float)(-(4 - var7)) * var6 * 1.7F;
    060            }
    061        }
    062
    063        /**
    064         * Sets the models various rotation angles then renders the model.
    065         */
    066        public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
    067        {
    068            this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
    069            this.field_78108_b.render(par7);
    070
    071            for (int var8 = 0; var8 < this.field_78109_a.length; ++var8)
    072            {
    073                this.field_78109_a[var8].render(par7);
    074            }
    075        }
    076    }