Сделай норм мультипоины и отводка плавная щяс детектит так что экспериментируй, сделай норм сброс спринта, без авто сприна попробуй мб из за него, джитеры сделай больше/меньше
// ========== ПОЛЯ ДЛЯ ПЛАВНОЙ ОТВОДКИ ==========
private boolean isReturningToOriginal = false;
private boolean isSmoothStarting = false;
private float targetYaw = 0F;
private float targetPitch = 0F;
private float startYaw = 0F;
private float startPitch = 0F;
private long transitionStartTime = 0L;
private static final long TRANSITION_DURATION = 1500L;
private final PerlinNoise transitionNoise = new PerlinNoise();
private long transitionNoiseSeed = 0L;
private float originalPlayerYaw = 0F;
private float originalPlayerPitch = 0F;
// ========== МЕТОД НАЧАЛА ПЛАВНОГО ВКЛЮЧЕНИЯ ==========
private void startSmoothStart() {
RotationHandler handler = Rockstar.getInstance().getRotationHandler();
Rotation currentRotation = handler.getCurrentRotation();
startYaw = currentRotation.getYaw();
startPitch = currentRotation.getPitch();
originalPlayerYaw = mc.player.getYaw();
originalPlayerPitch = mc.player.getPitch();
targetYaw = originalPlayerYaw;
targetPitch = originalPlayerPitch;
transitionStartTime = System.currentTimeMillis();
transitionNoiseSeed = System.currentTimeMillis();
isSmoothStarting = true;
isReturningToOriginal = false;
}
// ========== МЕТОД НАЧАЛА ПЛАВНОГО ВЫКЛЮЧЕНИЯ ==========
private void startSmoothReturn() {
RotationHandler handler = Rockstar.getInstance().getRotationHandler();
Rotation currentRotation = handler.getCurrentRotation();
startYaw = currentRotation.getYaw();
startPitch = currentRotation.getPitch();
targetYaw = originalPlayerYaw + (float)((Math.random() - 0.5) * 1.5);
targetPitch = originalPlayerPitch + (float)((Math.random() - 0.5) * 1.0);
targetYaw = MathHelper.wrapDegrees(targetYaw);
targetPitch = MathHelper.clamp(targetPitch, -90.0F, 90.0F);
transitionStartTime = System.currentTimeMillis();
transitionNoiseSeed = System.currentTimeMillis();
isReturningToOriginal = true;
isSmoothStarting = false;
}
// ========== МЕТОД ОБРАБОТКИ ПЛАВНОГО ПЕРЕХОДА ==========
private void handleSmoothTransition(boolean isStarting) {
RotationHandler handler = Rockstar.getInstance().getRotationHandler();
long currentTime = System.currentTimeMillis();
long elapsed = currentTime - transitionStartTime;
if (elapsed >= TRANSITION_DURATION) {
if (!isStarting) {
handler.rotate(
new Rotation(targetYaw, targetPitch),
MoveCorrection.NONE,
180.0F,
180.0F,
0.0F,
RotationPriority.NORMAL
);
}
isReturningToOriginal = false;
isSmoothStarting = false;
return;
}
double progress = (double) elapsed / TRANSITION_DURATION;
if (progress < 0.5) {
progress = 8 * progress * progress * progress * progress;
} else {
progress = 1 - Math.pow(-2 * progress + 2, 4) / 2;
}
float currentYaw = (float) (startYaw + (targetYaw - startYaw) * progress);
float currentPitch = (float) (startPitch + (targetPitch - startPitch) * progress);
double noiseValue1 = transitionNoise.noise(transitionNoiseSeed * 0.0006, elapsed * 0.0012);
double noiseValue2 = transitionNoise.noise(transitionNoiseSeed * 0.0009, elapsed * 0.0018);
float yawNoise = (float) (noiseValue1 * 0.8 * (1.0 - progress * 0.7));
float pitchNoise = (float) (noiseValue2 * 0.6 * (1.0 - progress * 0.7));
currentYaw += yawNoise;
currentPitch += pitchNoise;
currentYaw = MathHelper.wrapDegrees(currentYaw);
currentPitch = MathHelper.clamp(currentPitch, -90.0F, 90.0F);
float yawDiff = Math.abs(RotationMath.getAngleDifference(currentYaw, isStarting ? originalPlayerYaw : targetYaw));
float pitchDiff = Math.abs(RotationMath.getAngleDifference(currentPitch, isStarting ? originalPlayerPitch : targetPitch));
float maxSpeed = 90.0F;
float yawSpeed = Math.min(maxSpeed, (yawDiff * 0.8F) + 15.0F);
float pitchSpeed = Math.min(maxSpeed, (pitchDiff * 0.6F) + 10.0F);
handler.rotate(
new Rotation(currentYaw, currentPitch),
MoveCorrection.NONE,
yawSpeed,
pitchSpeed,
0.0F,
RotationPriority.NORMAL
);
}