    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 ModelSquid extends ModelBase
    008    {
    009        /** The squid's body */
    010        ModelRenderer squidBody;
    011
    012        /** The squid's tentacles */
    013        ModelRenderer[] squidTentacles = new ModelRenderer[8];
    014
    015        public ModelSquid()
    016        {
    017            byte var1 = -16;
    018            this.squidBody = new ModelRenderer(this, 0, 0);
    019            this.squidBody.addBox(-6.0F, -8.0F, -6.0F, 12, 16, 12);
    020            this.squidBody.rotationPointY += (float)(24 + var1);
    021
    022            for (int var2 = 0; var2 < this.squidTentacles.length; ++var2)
    023            {
    024                this.squidTentacles[var2] = new ModelRenderer(this, 48, 0);
    025                double var3 = (double)var2 * Math.PI * 2.0D / (double)this.squidTentacles.length;
    026                float var5 = (float)Math.cos(var3) * 5.0F;
    027                float var6 = (float)Math.sin(var3) * 5.0F;
    028                this.squidTentacles[var2].addBox(-1.0F, 0.0F, -1.0F, 2, 18, 2);
    029                this.squidTentacles[var2].rotationPointX = var5;
    030                this.squidTentacles[var2].rotationPointZ = var6;
    031                this.squidTentacles[var2].rotationPointY = (float)(31 + var1);
    032                var3 = (double)var2 * Math.PI * -2.0D / (double)this.squidTentacles.length + (Math.PI / 2D);
    033                this.squidTentacles[var2].rotateAngleY = (float)var3;
    034            }
    035        }
    036
    037        /**
    038         * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
    039         * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
    040         * "far" arms and legs can swing at most.
    041         */
    042        public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6)
    043        {
    044            ModelRenderer[] var7 = this.squidTentacles;
    045            int var8 = var7.length;
    046
    047            for (int var9 = 0; var9 < var8; ++var9)
    048            {
    049                ModelRenderer var10 = var7[var9];
    050                var10.rotateAngleX = par3;
    051            }
    052        }
    053
    054        /**
    055         * Sets the models various rotation angles then renders the model.
    056         */
    057        public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
    058        {
    059            this.setRotationAngles(par2, par3, par4, par5, par6, par7);
    060            this.squidBody.render(par7);
    061            ModelRenderer[] var8 = this.squidTentacles;
    062            int var9 = var8.length;
    063
    064            for (int var10 = 0; var10 < var9; ++var10)
    065            {
    066                ModelRenderer var11 = var8[var10];
    067                var11.render(par7);
    068            }
    069        }
    070    }