Esempio n. 1
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) {
    EntityIronGolem entityirongolem = (EntityIronGolem) entitylivingbaseIn;
    int i = entityirongolem.getAttackTimer();

    if (i > 0) {
      this.ironGolemRightArm.rotateAngleX =
          -2.0F + 1.5F * this.triangleWave((float) i - partialTickTime, 10.0F);
      this.ironGolemLeftArm.rotateAngleX =
          -2.0F + 1.5F * this.triangleWave((float) i - partialTickTime, 10.0F);
    } else {
      int j = entityirongolem.getHoldRoseTick();

      if (j > 0) {
        this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.triangleWave((float) j, 70.0F);
        this.ironGolemLeftArm.rotateAngleX = 0.0F;
      } else {
        this.ironGolemRightArm.rotateAngleX =
            (-0.2F + 1.5F * this.triangleWave(p_78086_2_, 13.0F)) * p_78086_3_;
        this.ironGolemLeftArm.rotateAngleX =
            (-0.2F - 1.5F * this.triangleWave(p_78086_2_, 13.0F)) * p_78086_3_;
      }
    }
  }