Beispiel #1
0
        public ModelPlayer(float p_i46304_1_, boolean p_i46304_2_, bool _19 = true) :
            base(p_i46304_1_, 0.0F, 64, _19 ? 64 : 32)
        {
            this._19       = _19;
            this.smallArms = p_i46304_2_;
            //this.bipedCape = new ModelRenderer(this, 0, 0);
            //this.bipedCape.setTextureSize(64, 32);
            //this.bipedCape.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, p_i46304_1_);

            if (p_i46304_2_)
            {
                boxList.Remove(this.bipedRightArm);
                boxList.Remove(this.bipedLeftArm);

                this.bipedRightArm = new ModelRenderer(this, 40, 16, ModelPart.RightArm);
                this.bipedRightArm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_, "Right Arm");
                this.bipedRightArm.setRotationPoint(-5.0F, 2.5F, 0.0F);

                if (_19)
                {
                    this.bipedLeftArm = new ModelRenderer(this, 32, 48, ModelPart.LeftArm);
                    this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_, "Left Arm");
                    this.bipedLeftArm.setRotationPoint(5.0F, 2.5F, 0.0F);
                }
                else
                {
                    this.bipedLeftArm        = new ModelRenderer(this, 40, 16, ModelPart.LeftArm);
                    this.bipedLeftArm.mirror = true;
                    this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_, "Left Arm");
                    this.bipedLeftArm.setRotationPoint(5.0F, 2.5F, 0.0F);
                }

                if (_19)
                {
                    this.bipedLeftArmwear = new ModelRenderer(this, 48, 48, ModelPart.LeftArmArmor);
                    this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_ + 0.25F, "Left Armwear");
                    this.bipedLeftArmwear.setRotationPoint(5.0F, 2.5F, 0.0F);
                    this.bipedRightArmwear = new ModelRenderer(this, 40, 32, ModelPart.RightArmArmor);
                    this.bipedRightArmwear.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_ + 0.25F, "Right Armwear");
                    this.bipedRightArmwear.setRotationPoint(-5.0F, 2.5F, 10.0F);
                }
            }
            else
            {
                if (_19)
                {
                    boxList.Remove(this.bipedLeftArm);
                    this.bipedLeftArm = new ModelRenderer(this, 32, 48, ModelPart.LeftArm);
                    this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i46304_1_, "Left Arm");
                    this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F);

                    this.bipedLeftArmwear = new ModelRenderer(this, 48, 48, ModelPart.LeftArmArmor);
                    this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i46304_1_ + 0.25F, "Left Armwear");
                    this.bipedLeftArmwear.setRotationPoint(5.0F, 2.0F, 0.0F);
                    this.bipedRightArmwear = new ModelRenderer(this, 40, 32, ModelPart.RightArmArmor);
                    this.bipedRightArmwear.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, p_i46304_1_ + 0.25F, "Right Armwear");
                    this.bipedRightArmwear.setRotationPoint(-5.0F, 2.0F, 10.0F);
                }
            }

            if (_19)
            {
                boxList.Remove(this.bipedLeftLeg);
                this.bipedLeftLeg = new ModelRenderer(this, 16, 48, ModelPart.LeftLeg);
                this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i46304_1_, "Left Leg");
                this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F);
                this.bipedLeftLegwear = new ModelRenderer(this, 0, 48, ModelPart.LeftLegArmor);
                this.bipedLeftLegwear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i46304_1_ + 0.25F, "Left Legwear");
                this.bipedLeftLegwear.setRotationPoint(1.9F, 12.0F, 0.0F);
                this.bipedRightLegwear = new ModelRenderer(this, 0, 32, ModelPart.RightLegArmor);
                this.bipedRightLegwear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i46304_1_ + 0.25F, "Right Legwear");
                this.bipedRightLegwear.setRotationPoint(-1.9F, 12.0F, 0.0F);
                this.bipedBodyWear = new ModelRenderer(this, 16, 32, ModelPart.ChestArmor);
                this.bipedBodyWear.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i46304_1_ + 0.25F, "Bodywear");
                this.bipedBodyWear.setRotationPoint(0.0F, 0.0F, 0.0F);
            }

            this.bipedHead.isSolid     = true;
            this.bipedBody.isSolid     = true;
            this.bipedLeftLeg.isSolid  = true;
            this.bipedRightLeg.isSolid = true;
            this.bipedLeftArm.isSolid  = true;
            this.bipedRightArm.isSolid = true;

            if (_19)
            {
                this.bipedLeftLegwear.isArmor  = true;
                this.bipedRightLegwear.isArmor = true;
                this.bipedBodyWear.isArmor     = true;
                this.bipedHeadwear.isArmor     = true;
                this.bipedLeftArmwear.isArmor  = true;
                this.bipedRightArmwear.isArmor = true;
            }
        }
Beispiel #2
0
        /**
         * Sets the models various rotation angles then renders the model.
         */
        public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale)
        {
            EntityHorse    entityhorse    = (EntityHorse)entityIn;
            HorseArmorType horsearmortype = entityhorse.getType();
            float          f     = entityhorse.getGrassEatingAmount(0.0F);
            boolean        flag  = entityhorse.isAdultHorse();
            boolean        flag1 = flag && entityhorse.isHorseSaddled();
            boolean        flag2 = flag && entityhorse.isChested();
            boolean        flag3 = horsearmortype.func_188601_g();
            float          f1    = entityhorse.getHorseSize();
            boolean        flag4 = entityhorse.isBeingRidden();

            if (flag1)
            {
                this.horseFaceRopes.render(scale);
                this.horseSaddleBottom.render(scale);
                this.horseSaddleFront.render(scale);
                this.horseSaddleBack.render(scale);
                this.horseLeftSaddleRope.render(scale);
                this.horseLeftSaddleMetal.render(scale);
                this.horseRightSaddleRope.render(scale);
                this.horseRightSaddleMetal.render(scale);
                this.horseLeftFaceMetal.render(scale);
                this.horseRightFaceMetal.render(scale);

                if (flag4)
                {
                    this.horseLeftRein.render(scale);
                    this.horseRightRein.render(scale);
                }
            }

            if (!flag)
            {
                GlStateManager.pushMatrix();
                GlStateManager.scale(f1, 0.5F + f1 * 0.5F, f1);
                GlStateManager.translate(0.0F, 0.95F * (1.0F - f1), 0.0F);
            }

            this.backLeftLeg.render(scale);
            this.backLeftShin.render(scale);
            this.backLeftHoof.render(scale);
            this.backRightLeg.render(scale);
            this.backRightShin.render(scale);
            this.backRightHoof.render(scale);
            this.frontLeftLeg.render(scale);
            this.frontLeftShin.render(scale);
            this.frontLeftHoof.render(scale);
            this.frontRightLeg.render(scale);
            this.frontRightShin.render(scale);
            this.frontRightHoof.render(scale);

            if (!flag)
            {
                GlStateManager.popMatrix();
                GlStateManager.pushMatrix();
                GlStateManager.scale(f1, f1, f1);
                GlStateManager.translate(0.0F, 1.35F * (1.0F - f1), 0.0F);
            }

            this.body.render(scale);
            this.tailBase.render(scale);
            this.tailMiddle.render(scale);
            this.tailTip.render(scale);
            this.neck.render(scale);
            this.mane.render(scale);

            if (!flag)
            {
                GlStateManager.popMatrix();
                GlStateManager.pushMatrix();
                float f2 = 0.5F + f1 * f1 * 0.5F;
                GlStateManager.scale(f2, f2, f2);

                if (f <= 0.0F)
                {
                    GlStateManager.translate(0.0F, 1.35F * (1.0F - f1), 0.0F);
                }
                else
                {
                    GlStateManager.translate(0.0F, 0.9F * (1.0F - f1) * f + 1.35F * (1.0F - f1) * (1.0F - f), 0.15F * (1.0F - f1) * f);
                }
            }

            if (flag3)
            {
                this.muleLeftEar.render(scale);
                this.muleRightEar.render(scale);
            }
            else
            {
                this.horseLeftEar.render(scale);
                this.horseRightEar.render(scale);
            }

            this.head.render(scale);

            if (!flag)
            {
                GlStateManager.popMatrix();
            }

            if (flag2)
            {
                this.muleLeftChest.render(scale);
                this.muleRightChest.render(scale);
            }
        }
Beispiel #3
0
        /**
         * Used for easily adding entity-dependent animations. The second and third float params here are the same second
         * and third as in the setRotationAngles method.
         */
        public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)
        {
            float f  = this.updateHorseRotation(entitylivingbaseIn.prevRenderYawOffset, entitylivingbaseIn.renderYawOffset, partialTickTime);
            float f1 = this.updateHorseRotation(entitylivingbaseIn.prevRotationYawHead, entitylivingbaseIn.rotationYawHead, partialTickTime);
            float f2 = entitylivingbaseIn.prevRotationPitch + (entitylivingbaseIn.rotationPitch - entitylivingbaseIn.prevRotationPitch) * partialTickTime;
            float f3 = f1 - f;
            float f4 = f2 * 0.017453292F;

            if (f3 > 20.0F)
            {
                f3 = 20.0F;
            }

            if (f3 < -20.0F)
            {
                f3 = -20.0F;
            }

            if (p_78086_3_ > 0.2F)
            {
                f4 += MathHelper.cos(p_78086_2_ * 0.4F) * 0.15F * p_78086_3_;
            }

            EntityHorse entityhorse = (EntityHorse)entitylivingbaseIn;
            float       f5          = entityhorse.getGrassEatingAmount(partialTickTime);
            float       f6          = entityhorse.getRearingAmount(partialTickTime);
            float       f7          = 1.0F - f6;
            float       f8          = entityhorse.getMouthOpennessAngle(partialTickTime);
            boolean     flag        = entityhorse.field_110278_bp != 0;
            boolean     flag1       = entityhorse.isHorseSaddled();
            boolean     flag2       = entityhorse.isBeingRidden();
            float       f9          = (float)entitylivingbaseIn.ticksExisted + partialTickTime;
            float       f10         = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI);
            float       f11         = f10 * 0.8F * p_78086_3_;

            this.head.rotationPointY           = 4.0F;
            this.head.rotationPointZ           = -10.0F;
            this.tailBase.rotationPointY       = 3.0F;
            this.tailMiddle.rotationPointZ     = 14.0F;
            this.muleRightChest.rotationPointY = 3.0F;
            this.muleRightChest.rotationPointZ = 10.0F;
            this.body.rotateAngleX             = 0.0F;
            this.head.rotateAngleX             = 0.5235988F + f4;
            this.head.rotateAngleY             = f3 * 0.017453292F;
            this.head.rotateAngleX             = f6 * (0.2617994F + f4) + f5 * 2.18166F + (1.0F - Math.max(f6, f5)) * this.head.rotateAngleX;
            this.head.rotateAngleY             = f6 * f3 * 0.017453292F + (1.0F - Math.max(f6, f5)) * this.head.rotateAngleY;
            this.head.rotationPointY           = f6 * -6.0F + f5 * 11.0F + (1.0F - Math.max(f6, f5)) * this.head.rotationPointY;
            this.head.rotationPointZ           = f6 * -1.0F + f5 * -10.0F + (1.0F - Math.max(f6, f5)) * this.head.rotationPointZ;
            this.tailBase.rotationPointY       = f6 * 9.0F + f7 * this.tailBase.rotationPointY;
            this.tailMiddle.rotationPointZ     = f6 * 18.0F + f7 * this.tailMiddle.rotationPointZ;
            this.muleRightChest.rotationPointY = f6 * 5.5F + f7 * this.muleRightChest.rotationPointY;
            this.muleRightChest.rotationPointZ = f6 * 15.0F + f7 * this.muleRightChest.rotationPointZ;
            this.body.rotateAngleX             = f6 * -45.0F * 0.017453292F + f7 * this.body.rotateAngleX;
            this.horseLeftEar.rotationPointY   = this.head.rotationPointY;
            this.horseRightEar.rotationPointY  = this.head.rotationPointY;
            this.muleLeftEar.rotationPointY    = this.head.rotationPointY;
            this.muleRightEar.rotationPointY   = this.head.rotationPointY;
            this.neck.rotationPointY           = this.head.rotationPointY;
            this.field_178711_b.rotationPointY = 0.02F;
            this.field_178712_c.rotationPointY = 0.0F;
            this.mane.rotationPointY           = this.head.rotationPointY;
            this.horseLeftEar.rotationPointZ   = this.head.rotationPointZ;
            this.horseRightEar.rotationPointZ  = this.head.rotationPointZ;
            this.muleLeftEar.rotationPointZ    = this.head.rotationPointZ;
            this.muleRightEar.rotationPointZ   = this.head.rotationPointZ;
            this.neck.rotationPointZ           = this.head.rotationPointZ;
            this.field_178711_b.rotationPointZ = 0.02F - f8;
            this.field_178712_c.rotationPointZ = f8;
            this.mane.rotationPointZ           = this.head.rotationPointZ;
            this.horseLeftEar.rotateAngleX     = this.head.rotateAngleX;
            this.horseRightEar.rotateAngleX    = this.head.rotateAngleX;
            this.muleLeftEar.rotateAngleX      = this.head.rotateAngleX;
            this.muleRightEar.rotateAngleX     = this.head.rotateAngleX;
            this.neck.rotateAngleX             = this.head.rotateAngleX;
            this.field_178711_b.rotateAngleX   = -0.09424778F * f8;
            this.field_178712_c.rotateAngleX   = 0.15707964F * f8;
            this.mane.rotateAngleX             = this.head.rotateAngleX;
            this.horseLeftEar.rotateAngleY     = this.head.rotateAngleY;
            this.horseRightEar.rotateAngleY    = this.head.rotateAngleY;
            this.muleLeftEar.rotateAngleY      = this.head.rotateAngleY;
            this.muleRightEar.rotateAngleY     = this.head.rotateAngleY;
            this.neck.rotateAngleY             = this.head.rotateAngleY;
            this.field_178711_b.rotateAngleY   = 0.0F;
            this.field_178712_c.rotateAngleY   = 0.0F;
            this.mane.rotateAngleY             = this.head.rotateAngleY;
            this.muleLeftChest.rotateAngleX    = f11 / 5.0F;
            this.muleRightChest.rotateAngleX   = -f11 / 5.0F;
            float f12 = ((float)Math.PI / 2F);
            float f13 = ((float)Math.PI * 3F / 2F);
            float f14 = -1.0471976F;
            float f15 = 0.2617994F * f6;
            float f16 = MathHelper.cos(f9 * 0.6F + (float)Math.PI);

            this.frontLeftLeg.rotationPointY  = -2.0F * f6 + 9.0F * f7;
            this.frontLeftLeg.rotationPointZ  = -2.0F * f6 + -8.0F * f7;
            this.frontRightLeg.rotationPointY = this.frontLeftLeg.rotationPointY;
            this.frontRightLeg.rotationPointZ = this.frontLeftLeg.rotationPointZ;
            this.backLeftShin.rotationPointY  = this.backLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f15 + f7 * -f10 * 0.5F * p_78086_3_) * 7.0F;
            this.backLeftShin.rotationPointZ  = this.backLeftLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + f15 + f7 * -f10 * 0.5F * p_78086_3_) * 7.0F;
            this.backRightShin.rotationPointY = this.backRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f15 + f7 * f10 * 0.5F * p_78086_3_) * 7.0F;
            this.backRightShin.rotationPointZ = this.backRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + f15 + f7 * f10 * 0.5F * p_78086_3_) * 7.0F;
            float f17 = (-1.0471976F + f16) * f6 + f11 * f7;
            float f18 = (-1.0471976F + -f16) * f6 + -f11 * f7;

            this.frontLeftShin.rotationPointY  = this.frontLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f17) * 7.0F;
            this.frontLeftShin.rotationPointZ  = this.frontLeftLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + f17) * 7.0F;
            this.frontRightShin.rotationPointY = this.frontRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f18) * 7.0F;
            this.frontRightShin.rotationPointZ = this.frontRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + f18) * 7.0F;
            this.backLeftLeg.rotateAngleX      = f15 + -f10 * 0.5F * p_78086_3_ * f7;
            this.backLeftShin.rotateAngleX     = -0.08726646F * f6 + (-f10 * 0.5F * p_78086_3_ - Math.max(0.0F, f10 * 0.5F * p_78086_3_)) * f7;
            this.backLeftHoof.rotateAngleX     = this.backLeftShin.rotateAngleX;
            this.backRightLeg.rotateAngleX     = f15 + f10 * 0.5F * p_78086_3_ * f7;
            this.backRightShin.rotateAngleX    = -0.08726646F * f6 + (f10 * 0.5F * p_78086_3_ - Math.max(0.0F, -f10 * 0.5F * p_78086_3_)) * f7;
            this.backRightHoof.rotateAngleX    = this.backRightShin.rotateAngleX;
            this.frontLeftLeg.rotateAngleX     = f17;
            this.frontLeftShin.rotateAngleX    = (this.frontLeftLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F + f16 * 0.2F)) * f6 + (f11 + Math.max(0.0F, f10 * 0.5F * p_78086_3_)) * f7;
            this.frontLeftHoof.rotateAngleX    = this.frontLeftShin.rotateAngleX;
            this.frontRightLeg.rotateAngleX    = f18;
            this.frontRightShin.rotateAngleX   = (this.frontRightLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F - f16 * 0.2F)) * f6 + (-f11 + Math.max(0.0F, -f10 * 0.5F * p_78086_3_)) * f7;
            this.frontRightHoof.rotateAngleX   = this.frontRightShin.rotateAngleX;
            this.backLeftHoof.rotationPointY   = this.backLeftShin.rotationPointY;
            this.backLeftHoof.rotationPointZ   = this.backLeftShin.rotationPointZ;
            this.backRightHoof.rotationPointY  = this.backRightShin.rotationPointY;
            this.backRightHoof.rotationPointZ  = this.backRightShin.rotationPointZ;
            this.frontLeftHoof.rotationPointY  = this.frontLeftShin.rotationPointY;
            this.frontLeftHoof.rotationPointZ  = this.frontLeftShin.rotationPointZ;
            this.frontRightHoof.rotationPointY = this.frontRightShin.rotationPointY;
            this.frontRightHoof.rotationPointZ = this.frontRightShin.rotationPointZ;

            if (flag1)
            {
                this.horseSaddleBottom.rotationPointY     = f6 * 0.5F + f7 * 2.0F;
                this.horseSaddleBottom.rotationPointZ     = f6 * 11.0F + f7 * 2.0F;
                this.horseSaddleFront.rotationPointY      = this.horseSaddleBottom.rotationPointY;
                this.horseSaddleBack.rotationPointY       = this.horseSaddleBottom.rotationPointY;
                this.horseLeftSaddleRope.rotationPointY   = this.horseSaddleBottom.rotationPointY;
                this.horseRightSaddleRope.rotationPointY  = this.horseSaddleBottom.rotationPointY;
                this.horseLeftSaddleMetal.rotationPointY  = this.horseSaddleBottom.rotationPointY;
                this.horseRightSaddleMetal.rotationPointY = this.horseSaddleBottom.rotationPointY;
                this.muleLeftChest.rotationPointY         = this.muleRightChest.rotationPointY;
                this.horseSaddleFront.rotationPointZ      = this.horseSaddleBottom.rotationPointZ;
                this.horseSaddleBack.rotationPointZ       = this.horseSaddleBottom.rotationPointZ;
                this.horseLeftSaddleRope.rotationPointZ   = this.horseSaddleBottom.rotationPointZ;
                this.horseRightSaddleRope.rotationPointZ  = this.horseSaddleBottom.rotationPointZ;
                this.horseLeftSaddleMetal.rotationPointZ  = this.horseSaddleBottom.rotationPointZ;
                this.horseRightSaddleMetal.rotationPointZ = this.horseSaddleBottom.rotationPointZ;
                this.muleLeftChest.rotationPointZ         = this.muleRightChest.rotationPointZ;
                this.horseSaddleBottom.rotateAngleX       = this.body.rotateAngleX;
                this.horseSaddleFront.rotateAngleX        = this.body.rotateAngleX;
                this.horseSaddleBack.rotateAngleX         = this.body.rotateAngleX;
                this.horseLeftRein.rotationPointY         = this.head.rotationPointY;
                this.horseRightRein.rotationPointY        = this.head.rotationPointY;
                this.horseFaceRopes.rotationPointY        = this.head.rotationPointY;
                this.horseLeftFaceMetal.rotationPointY    = this.head.rotationPointY;
                this.horseRightFaceMetal.rotationPointY   = this.head.rotationPointY;
                this.horseLeftRein.rotationPointZ         = this.head.rotationPointZ;
                this.horseRightRein.rotationPointZ        = this.head.rotationPointZ;
                this.horseFaceRopes.rotationPointZ        = this.head.rotationPointZ;
                this.horseLeftFaceMetal.rotationPointZ    = this.head.rotationPointZ;
                this.horseRightFaceMetal.rotationPointZ   = this.head.rotationPointZ;
                this.horseLeftRein.rotateAngleX           = f4;
                this.horseRightRein.rotateAngleX          = f4;
                this.horseFaceRopes.rotateAngleX          = this.head.rotateAngleX;
                this.horseLeftFaceMetal.rotateAngleX      = this.head.rotateAngleX;
                this.horseRightFaceMetal.rotateAngleX     = this.head.rotateAngleX;
                this.horseFaceRopes.rotateAngleY          = this.head.rotateAngleY;
                this.horseLeftFaceMetal.rotateAngleY      = this.head.rotateAngleY;
                this.horseLeftRein.rotateAngleY           = this.head.rotateAngleY;
                this.horseRightFaceMetal.rotateAngleY     = this.head.rotateAngleY;
                this.horseRightRein.rotateAngleY          = this.head.rotateAngleY;

                if (flag2)
                {
                    this.horseLeftSaddleRope.rotateAngleX   = -1.0471976F;
                    this.horseLeftSaddleMetal.rotateAngleX  = -1.0471976F;
                    this.horseRightSaddleRope.rotateAngleX  = -1.0471976F;
                    this.horseRightSaddleMetal.rotateAngleX = -1.0471976F;
                    this.horseLeftSaddleRope.rotateAngleZ   = 0.0F;
                    this.horseLeftSaddleMetal.rotateAngleZ  = 0.0F;
                    this.horseRightSaddleRope.rotateAngleZ  = 0.0F;
                    this.horseRightSaddleMetal.rotateAngleZ = 0.0F;
                }
                else
                {
                    this.horseLeftSaddleRope.rotateAngleX   = f11 / 3.0F;
                    this.horseLeftSaddleMetal.rotateAngleX  = f11 / 3.0F;
                    this.horseRightSaddleRope.rotateAngleX  = f11 / 3.0F;
                    this.horseRightSaddleMetal.rotateAngleX = f11 / 3.0F;
                    this.horseLeftSaddleRope.rotateAngleZ   = f11 / 5.0F;
                    this.horseLeftSaddleMetal.rotateAngleZ  = f11 / 5.0F;
                    this.horseRightSaddleRope.rotateAngleZ  = -f11 / 5.0F;
                    this.horseRightSaddleMetal.rotateAngleZ = -f11 / 5.0F;
                }
            }

            f12 = -1.3089F + p_78086_3_ * 1.5F;

            if (f12 > 0.0F)
            {
                f12 = 0.0F;
            }

            if (flag)
            {
                this.tailBase.rotateAngleY = MathHelper.cos(f9 * 0.7F);
                f12 = 0.0F;
            }
            else
            {
                this.tailBase.rotateAngleY = 0.0F;
            }

            this.tailMiddle.rotateAngleY   = this.tailBase.rotateAngleY;
            this.tailTip.rotateAngleY      = this.tailBase.rotateAngleY;
            this.tailMiddle.rotationPointY = this.tailBase.rotationPointY;
            this.tailTip.rotationPointY    = this.tailBase.rotationPointY;
            this.tailMiddle.rotationPointZ = this.tailBase.rotationPointZ;
            this.tailTip.rotationPointZ    = this.tailBase.rotationPointZ;
            this.tailBase.rotateAngleX     = f12;
            this.tailMiddle.rotateAngleX   = f12;
            this.tailTip.rotateAngleX      = -0.2618F + f12;
        }
Beispiel #4
0
        //@SuppressWarnings("incomplete-switch")

        /**
         * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
         * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
         * "far" arms and legs can swing at most.
         */
        public virtual void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
        {
            boolean flag = entityIn is EntityLivingBase && ((EntityLivingBase)entityIn).func_184599_cB() > 4;

            this.bipedHead.rotateAngleY = netHeadYaw * 0.017453292F;

            if (flag)
            {
                this.bipedHead.rotateAngleX = -((float)Math.PI / 4F);
            }
            else
            {
                this.bipedHead.rotateAngleX = headPitch * 0.017453292F;
            }

            this.bipedBody.rotateAngleY       = 0.0F;
            this.bipedRightArm.rotationPointZ = 0.0F;
            this.bipedRightArm.rotationPointX = -5.0F;
            this.bipedLeftArm.rotationPointZ  = 0.0F;
            this.bipedLeftArm.rotationPointX  = 5.0F;
            float f = 1.0F;

            if (flag)
            {
                f = (float)(entityIn.motionX * entityIn.motionX + entityIn.motionY * entityIn.motionY + entityIn.motionZ * entityIn.motionZ);
                f = f / 0.2F;
                f = f * f * f;
            }

            if (f < 1.0F)
            {
                f = 1.0F;
            }

            //this.bipedRightArm.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 2.0F * limbSwingAmount * 0.5F / f;
            //this.bipedLeftArm.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 2.0F * limbSwingAmount * 0.5F / f;
            this.bipedRightArm.rotateAngleZ = 0.0F;
            this.bipedLeftArm.rotateAngleZ  = 0.0F;
            this.bipedRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount / f;
            this.bipedLeftLeg.rotateAngleX  = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount / f;
            this.bipedRightLeg.rotateAngleY = 0.0F;
            this.bipedLeftLeg.rotateAngleY  = 0.0F;
            this.bipedRightLeg.rotateAngleZ = 0.0F;
            this.bipedLeftLeg.rotateAngleZ  = 0.0F;

            if (this.isRiding)
            {
                this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F);
                this.bipedLeftArm.rotateAngleX  += -((float)Math.PI / 5F);
                this.bipedRightLeg.rotateAngleX  = -1.4137167F;
                this.bipedRightLeg.rotateAngleY  = ((float)Math.PI / 10F);
                this.bipedRightLeg.rotateAngleZ  = 0.07853982F;
                this.bipedLeftLeg.rotateAngleX   = -1.4137167F;
                this.bipedLeftLeg.rotateAngleY   = -((float)Math.PI / 10F);
                this.bipedLeftLeg.rotateAngleZ   = -0.07853982F;
            }

            this.bipedRightArm.rotateAngleY = 0.0F;
            this.bipedRightArm.rotateAngleZ = 0.0F;

            switch (this.leftArmPose)
            {
            case ArmPose.EMPTY:
                this.bipedLeftArm.rotateAngleY = 0.0F;
                break;

            case ArmPose.BLOCK:
                this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - 0.9424779F;
                this.bipedLeftArm.rotateAngleY = 0.5235988F;
                break;

            case ArmPose.ITEM:
                this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F);
                this.bipedLeftArm.rotateAngleY = 0.0F;
                break;
            }

            switch (this.rightArmPose)
            {
            case ArmPose.EMPTY:
                this.bipedRightArm.rotateAngleY = 0.0F;
                break;

            case ArmPose.BLOCK:
                this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - 0.9424779F;
                this.bipedRightArm.rotateAngleY = -0.5235988F;
                break;

            case ArmPose.ITEM:
                this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F);
                this.bipedRightArm.rotateAngleY = 0.0F;
                break;
            }

            if (this.swingProgress > 0.0F)
            {
                EnumHandSide  enumhandside  = this.getMainHand(entityIn);
                ModelRenderer modelrenderer = this.getArmForSide(enumhandside);
                this.getArmForSide(enumhandside.opposite());
                float f1 = this.swingProgress;
                this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f1) * ((float)Math.PI * 2F)) * 0.2F;

                if (enumhandside == EnumHandSide.LEFT)
                {
                    this.bipedBody.rotateAngleY *= -1.0F;
                }

                this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
                this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
                this.bipedLeftArm.rotationPointZ  = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
                this.bipedLeftArm.rotationPointX  = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
                this.bipedRightArm.rotateAngleY  += this.bipedBody.rotateAngleY;
                this.bipedLeftArm.rotateAngleY   += this.bipedBody.rotateAngleY;
                this.bipedLeftArm.rotateAngleX   += this.bipedBody.rotateAngleY;
                f1 = 1.0F - this.swingProgress;
                f1 = f1 * f1;
                f1 = f1 * f1;
                f1 = 1.0F - f1;
                float f2 = MathHelper.sin(f1 * (float)Math.PI);
                float f3 = MathHelper.sin(this.swingProgress * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F;
                modelrenderer.rotateAngleX  = (float)((double)modelrenderer.rotateAngleX - ((double)f2 * 1.2D + (double)f3));
                modelrenderer.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
                modelrenderer.rotateAngleZ += MathHelper.sin(this.swingProgress * (float)Math.PI) * -0.4F;
            }

            if (this.isSneak)
            {
                this.bipedBody.rotateAngleX       = 0.5F;
                this.bipedRightArm.rotateAngleX  += 0.4F;
                this.bipedLeftArm.rotateAngleX   += 0.4F;
                this.bipedRightLeg.rotationPointZ = 4.0F;
                this.bipedLeftLeg.rotationPointZ  = 4.0F;
                this.bipedRightLeg.rotationPointY = 9.0F;
                this.bipedLeftLeg.rotationPointY  = 9.0F;
                this.bipedHead.rotationPointY     = 1.0F;
            }
            else
            {
                this.bipedBody.rotateAngleX       = 0.0F;
                this.bipedRightLeg.rotationPointZ = 0.1F;
                this.bipedLeftLeg.rotationPointZ  = 0.1F;
                this.bipedRightLeg.rotationPointY = 12.0F;
                this.bipedLeftLeg.rotationPointY  = 12.0F;
                this.bipedHead.rotationPointY     = 0.0F;
            }

            //this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
            //this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
            //this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
            //this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;

            if (this.rightArmPose == ModelBiped.ArmPose.BOW_AND_ARROW)
            {
                this.bipedRightArm.rotateAngleY = -0.1F + this.bipedHead.rotateAngleY;
                this.bipedLeftArm.rotateAngleY  = 0.1F + this.bipedHead.rotateAngleY + 0.4F;
                this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
                this.bipedLeftArm.rotateAngleX  = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
            }
            else if (this.leftArmPose == ModelBiped.ArmPose.BOW_AND_ARROW)
            {
                this.bipedRightArm.rotateAngleY = -0.1F + this.bipedHead.rotateAngleY - 0.4F;
                this.bipedLeftArm.rotateAngleY  = 0.1F + this.bipedHead.rotateAngleY;
                this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
                this.bipedLeftArm.rotateAngleX  = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
            }

            copyModelAngles(this.bipedHead, this.bipedHeadwear);
        }