float yawDelta = (wrapDegrees(yawToTarget - rotateVector.x));
float pitchDelta = (wrapDegrees(pitchToTarget - rotateVector.y));
int roundedYaw = (int) yawDelta;
switch (type.get()) {
case "FunTime" -> {
double yawSpeed, pitchSpeed;
if (MouseUtil.getMouseOver(target, rotateVector.x, rotateVector.y, attackRange.get()) != null) {
yawSpeed = MathUtil.randomWithUpdate(5, 25, 200, yawUpdate);
pitchSpeed = 0;
} else {
// TODO: if the target under the crosshair is null
yawSpeed = MathUtil.randomWithUpdate(19, 113, 100, yawUpdate);
pitchSpeed = MathUtil.randomWithUpdate(2, 17, 40, pitchUpdate);
}
float clampedYaw = (float) Math.min(Math.max(yawDelta, 1.0f), yawSpeed);
float clampedPitch = (float) Math.min(Math.max(pitchDelta * 0.33f, 1.0f), pitchSpeed);
float yaw = rotateVector.x + (yawDelta > 0 ? clampedYaw : -clampedYaw);
float pitch = clamp(rotateVector.y + (pitchDelta > 0 ? clampedPitch : -clampedPitch), -90, 90);
float gcd = SensUtils.getGCDValue();
yaw -= (yaw - rotateVector.x) % gcd;
pitch -= (pitch - rotateVector.y) % gcd;
rotateVector = new Vector2f(yaw, pitch);
lastYaw = clampedYaw;
lastPitch = clampedPitch;
if (options.getValueByName("Коррекция движения").get()) {
mc.player.rotationYawOffset = yaw;
}
}