private void drawString() {
long currentTime = System.currentTimeMillis();
long elapsedTime = currentTime - rotationStartTime;
float yawDiff = MathHelper.wrapAngleTo180_float(targetYaw - mc.thePlayer.rotationYaw);
float pitchDiff = targetPitch - mc.thePlayer.rotationPitch;
if (Math.abs(yawDiff) < 0.3F && Math.abs(pitchDiff) < 0.3F) {
mc.thePlayer.rotationYaw = targetYaw;
mc.thePlayer.rotationPitch = targetPitch;
isRotating = false;
return;
}
if (elapsedTime >= rotationDuration) {
mc.thePlayer.rotationYaw = targetYaw;
mc.thePlayer.rotationPitch = targetPitch;
isRotating = false;
return;
}
float progress = (float) elapsedTime / rotationDuration;
progress = progress < 0.5f ? 2 * progress * progress : 1 - (float)Math.pow(-2 * progress + 2, 2) / 2;
yawDiff = MathHelper.wrapAngleTo180_float(targetYaw - startYaw);
pitchDiff = targetPitch - startPitch;
mc.thePlayer.rotationYaw = startYaw + yawDiff * progress;
mc.thePlayer.rotationPitch = startPitch + pitchDiff * progress;
}
держи брат, все робить дожно)