else if (this.isElytraFlying()) {
double d10;
double d6;
float f2;
Vector3d motion = this.getMotion();
if (motion.y > -0.5) {
this.fallDistance = 1.0f;
}
Vector3d lookVector = this.getLookVec();
if (Expensive.getInstance().getFunctionRegistry().getAutoPilo().isState() && this instanceof ClientPlayerEntity) {
lookVector = this.getVectorForRotation(AutoPilo.rotateVector.y, AutoPilo.rotateVector.x);
}
if (Expensive.getInstance().getFunctionRegistry().getKillAura().isState() && KillAura.getTarget() != null && this instanceof ClientPlayerEntity) {
lookVector = this.getVectorForRotation(KillAura.rotateVector.y, KillAura.rotateVector.x);
}
float pitchRadians = this.rotationPitch * ((float) Math.PI / 180);
if (Expensive.getInstance().getFunctionRegistry().getKillAura().isState() && KillAura.getTarget() != null && this instanceof ClientPlayerEntity) {
pitchRadians = KillAura.rotateVector.y * ((float) Math.PI / 180);
}
double d1 = Math.sqrt(lookVector.x * lookVector.x + lookVector.z * lookVector.z);
double d3 = Math.sqrt(LivingEntity.horizontalMag(motion));
double d4 = lookVector.length();
float f1 = MathHelper.cos(pitchRadians);
f1 = (float) ((double) f1 * f1 * Math.min(1.0, d4 / 0.4));
motion = this.getMotion().add(0.0, d0 * (-1.0 + (double) f1 * 0.75), 0.0);
if (motion.y < 0.0 && d1 > 0.0) {
double d5 = motion.y * -0.1 * (double) f1;
motion = motion.add(lookVector.x * d5 / d1, d5, lookVector.z * d5 / d1);
}
if (pitchRadians < 0.0f && d1 > 0.0) {
double d9 = d3 * (double) (-MathHelper.sin(pitchRadians)) * 0.04;
motion = motion.add(-lookVector.x * d9 / d1, d9 * 3.2, -lookVector.z * d9 / d1);
}
if (d1 > 0.0) {
motion = motion.add((lookVector.x / d1 * d3 - motion.x) * 0.1, 0.0, (lookVector.z / d1 * d3 - motion.z) * 0.1);
}
this.setMotion(motion.mul(0.99f, 0.98f, 0.99f));
this.move(MoverType.SELF, this.getMotion());
if (this.collidedHorizontally && !this.world.isRemote) {
f2 = (float) ((d6 = d3 - (d10 = Math.sqrt(LivingEntity.horizontalMag(this.getMotion())))) * 10.0 - 3.0);
if (f2 > 0.0f) {
this.playSound(this.getFallSound((int) f2), 1.0f, 1.0f);
this.attackEntityFrom(DamageSource.FLY_INTO_WALL, f2);
}
}
if (this.onGround && !this.world.isRemote) {
this.setFlag(7, false);
}
}