Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Вопрос Кикает за ротацию

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
21 Дек 2024
Сообщения
79
Реакции
0
1770390955225.png
короче нашел ротку крутую тут и меня с ней кикает постоянно даже в одиночном мире гпт сказал шо из за ротки я тоже так думаю помогите
 
кода нету
гадать не умеем и я надеюсь пакеты в ротации не используешь?
if (this.rotationMode.is(this.slothAngleRotation)) {
Rotation currentRot = handler.getCurrentRotation();
Vec3d nearestPoint = RotationMath.getNearestPoint(targetedEntity);
Rotation targetRot = RotationMath.getRotationTo(nearestPoint);

float yawDelta = RotationMath.getAngleDifference(currentRot.getYaw(), targetRot.getYaw());
float pitchDelta = RotationMath.getAngleDifference(currentRot.getPitch(), targetRot.getPitch());
float rotationDifference = (float)Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta));

if (rotationDifference < 0.01F) {
rotationDifference = 0.01F;
}

boolean canAttack = this.isCooledDown() && !this.attackTimer.finished(100L);
float distanceToTarget = (float)mc.player.distanceTo(targetedEntity);

float baseSpeed = canAttack ? 0.75F : 0.65F;

// Корректировка скорости для близкой дистанции
if (distanceToTarget > 0.0F && distanceToTarget < 0.66F) {
float closeRangeSpeed = MathHelper.clamp(distanceToTarget / 1.5F * 0.35F, 0.1F, 0.6F);
baseSpeed = canAttack ? 0.85F : Math.min(baseSpeed, closeRangeSpeed);
}

float lineYaw = Math.abs(yawDelta / rotationDifference) * 180.0F;
float linePitch = Math.abs(pitchDelta / rotationDifference) * 180.0F;

float jitterYaw = canAttack ? 0.0F : (float)(MathUtility.random(21.0, 28.2) * Math.sin(System.currentTimeMillis() / 20.0));
float jitterPitch = canAttack ? 0.0F : (float)(MathUtility.random(6.0, 23.8) * Math.sin(System.currentTimeMillis() / 22.0));

if (this.attackTimer.finished(1000L)) {
baseSpeed = 0.55F;
jitterYaw = 0.0F;
jitterPitch = 0.0F;
}

float moveYaw = MathHelper.clamp(yawDelta, -lineYaw, lineYaw);
float movePitch = MathHelper.clamp(pitchDelta, -linePitch, linePitch);

float finalYaw = MathUtility.interpolate(currentRot.getYaw(), currentRot.getYaw() + moveYaw, baseSpeed) + jitterYaw;
float finalPitch = MathUtility.interpolate(currentRot.getPitch(), currentRot.getPitch() + movePitch, baseSpeed) + jitterPitch;

finalPitch = Math.clamp(finalPitch, -89.9F, 89.9F);

if (Float.isNaN(finalYaw) || Float.isInfinite(finalYaw)) {
finalYaw = currentRot.getYaw();
}
if (Float.isNaN(finalPitch) || Float.isInfinite(finalPitch)) {
finalPitch = currentRot.getPitch();
}

handler.rotate(
new Rotation(finalYaw, finalPitch),
moveCorrection,
180.0F,
180.0F,
180.0F,
RotationPriority.TO_TARGET
);
}
 
if (this.rotationMode.is(this.slothAngleRotation)) {
Rotation currentRot = handler.getCurrentRotation();
Vec3d nearestPoint = RotationMath.getNearestPoint(targetedEntity);
Rotation targetRot = RotationMath.getRotationTo(nearestPoint);

float yawDelta = RotationMath.getAngleDifference(currentRot.getYaw(), targetRot.getYaw());
float pitchDelta = RotationMath.getAngleDifference(currentRot.getPitch(), targetRot.getPitch());
float rotationDifference = (float)Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta));

if (rotationDifference < 0.01F) {
rotationDifference = 0.01F;
}

boolean canAttack = this.isCooledDown() && !this.attackTimer.finished(100L);
float distanceToTarget = (float)mc.player.distanceTo(targetedEntity);

float baseSpeed = canAttack ? 0.75F : 0.65F;

// Корректировка скорости для близкой дистанции
if (distanceToTarget > 0.0F && distanceToTarget < 0.66F) {
float closeRangeSpeed = MathHelper.clamp(distanceToTarget / 1.5F * 0.35F, 0.1F, 0.6F);
baseSpeed = canAttack ? 0.85F : Math.min(baseSpeed, closeRangeSpeed);
}

float lineYaw = Math.abs(yawDelta / rotationDifference) * 180.0F;
float linePitch = Math.abs(pitchDelta / rotationDifference) * 180.0F;

float jitterYaw = canAttack ? 0.0F : (float)(MathUtility.random(21.0, 28.2) * Math.sin(System.currentTimeMillis() / 20.0));
float jitterPitch = canAttack ? 0.0F : (float)(MathUtility.random(6.0, 23.8) * Math.sin(System.currentTimeMillis() / 22.0));

if (this.attackTimer.finished(1000L)) {
baseSpeed = 0.55F;
jitterYaw = 0.0F;
jitterPitch = 0.0F;
}

float moveYaw = MathHelper.clamp(yawDelta, -lineYaw, lineYaw);
float movePitch = MathHelper.clamp(pitchDelta, -linePitch, linePitch);

float finalYaw = MathUtility.interpolate(currentRot.getYaw(), currentRot.getYaw() + moveYaw, baseSpeed) + jitterYaw;
float finalPitch = MathUtility.interpolate(currentRot.getPitch(), currentRot.getPitch() + movePitch, baseSpeed) + jitterPitch;

finalPitch = Math.clamp(finalPitch, -89.9F, 89.9F);

if (Float.isNaN(finalYaw) || Float.isInfinite(finalYaw)) {
finalYaw = currentRot.getYaw();
}
if (Float.isNaN(finalPitch) || Float.isInfinite(finalPitch)) {
finalPitch = currentRot.getPitch();
}

handler.rotate(
new Rotation(finalYaw, finalPitch),
moveCorrection,
180.0F,
180.0F,
180.0F,
RotationPriority.TO_TARGET
);
}
у тя скорее всего проблемы с утилками. попробуй убрать строку
handler.rotate(
new Rotation(finalYaw, finalPitch),
moveCorrection,
180.0F,
180.0F,
180.0F,
RotationPriority.TO_TARGET
); и отпиши че там
 
Назад
Сверху Снизу