package dev.wh1tew1ndows.client.managers.module.impl.combat.rotation;
import dev.wh1tew1ndows.client.api.interfaces.IMinecraft;
import dev.wh1tew1ndows.client.managers.component.impl.rotation.Rotation;
import dev.wh1tew1ndows.client.managers.component.impl.rotation.RotationComponent;
import dev.wh1tew1ndows.client.managers.module.impl.combat.AttackAura;
import dev.wh1tew1ndows.client.utils.math.Mathf;
import lombok.experimental.UtilityClass;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;
import java.security.SecureRandom;
import static dev.wh1tew1ndows.client.managers.module.impl.combat.AttackAura.*;
@UtilityClass
public class SlothACRotation implements IMinecraft {
private final SecureRandom random = new SecureRandom();
private float tick = 0;
public void rotation(LivingEntity target, boolean isAttack, float attackDistance, boolean check) {
if (target == null || mc.player == null) return;
Vector3d eyePos = mc.player.getEyePosition(mc.getRenderPartialTicks());
Vector3d targetPos = target.getPositionVec();
Vector3d targetPoint = targetPos.add(0, target.getHeight() / 2, 0);
Vector3d directionVec = targetPoint.subtract(eyePos).normalize();
float baseYaw = (float) Math.toDegrees(Math.atan2(-directionVec.x, directionVec.z));
float basePitch = (float) MathHelper.clamp(
-Math.toDegrees(Math.atan2(directionVec.y, Math.hypot(directionVec.x, directionVec.z))),
MIN_PITCH, MAX_PITCH
);
boolean attacking = false;
if (isAttack) tick = 4;
if (tick > 0) {
attacking = true;
tick--;
}
float yawJitter = 0;
float pitchJitter = 0;
if (!attacking) {
yawJitter = (float) (random.nextGaussian() * 0.3);
pitchJitter = (float) (random.nextGaussian() * 0.2);
}
float attackShift = 0;
if (attacking) {
attackShift = (float) (random.nextGaussian() * 0.5);
}
float finalYaw = baseYaw + yawJitter + attackShift;
float finalPitch = basePitch + pitchJitter + attackShift;
finalPitch = MathHelper.clamp(finalPitch, -90f, 90f);
Rotation newRotation = new Rotation(finalYaw, finalPitch);
float yawChangeSpeed = Mathf.randomValue(45, 65);
float pitchChangeSpeed = Mathf.randomValue(25, 45);
RotationComponent.update(
newRotation,
yawChangeSpeed,
pitchChangeSpeed,
Mathf.randomValue(15, 25),
Mathf.randomValue(8, 15),
0,
15,
false
);
}
public void rotationAggressive(LivingEntity target, boolean isAttack, float attackDistance, boolean check) {
if (target == null || mc.player == null) return;
Vector3d eyePos = mc.player.getEyePosition(mc.getRenderPartialTicks());
Vector3d targetPos = target.getPositionVec();
Vector3d targetPoint = targetPos.add(0, target.getHeight() * 0.85, 0);
Vector3d directionVec = targetPoint.subtract(eyePos).normalize();
float baseYaw = (float) Math.toDegrees(Math.atan2(-directionVec.x, directionVec.z));
float basePitch = (float) MathHelper.clamp(
-Math.toDegrees(Math.atan2(directionVec.y, Math.hypot(directionVec.x, directionVec.z))),
MIN_PITCH, MAX_PITCH
);
boolean attacking = false;
if (isAttack) tick = 3;
if (tick > 0) {
attacking = true;
tick--;
}
float yawJitter = (float) (random.nextGaussian() * 0.2);
float pitchJitter = (float) (random.nextGaussian() * 0.15);
float attackShift = attacking ? (float) (random.nextGaussian() * 0.3) : 0;
float finalYaw = baseYaw + yawJitter + attackShift;
float finalPitch = basePitch + pitchJitter + attackShift;
finalPitch = MathHelper.clamp(finalPitch, -90f, 90f);
Rotation newRotation = new Rotation(finalYaw, finalPitch);
float yawChangeSpeed = Mathf.randomValue(60, 85);
float pitchChangeSpeed = Mathf.randomValue(35, 60);
RotationComponent.update(
newRotation,
yawChangeSpeed,
pitchChangeSpeed,
Mathf.randomValue(20, 30),
Mathf.randomValue(10, 20),
0,
18,
false
);
}
public void reset() {
tick = 0;
}
}
помогите пожалуйста голову отводит зачем то на прицел помогите пж
import dev.wh1tew1ndows.client.api.interfaces.IMinecraft;
import dev.wh1tew1ndows.client.managers.component.impl.rotation.Rotation;
import dev.wh1tew1ndows.client.managers.component.impl.rotation.RotationComponent;
import dev.wh1tew1ndows.client.managers.module.impl.combat.AttackAura;
import dev.wh1tew1ndows.client.utils.math.Mathf;
import lombok.experimental.UtilityClass;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;
import java.security.SecureRandom;
import static dev.wh1tew1ndows.client.managers.module.impl.combat.AttackAura.*;
@UtilityClass
public class SlothACRotation implements IMinecraft {
private final SecureRandom random = new SecureRandom();
private float tick = 0;
public void rotation(LivingEntity target, boolean isAttack, float attackDistance, boolean check) {
if (target == null || mc.player == null) return;
Vector3d eyePos = mc.player.getEyePosition(mc.getRenderPartialTicks());
Vector3d targetPos = target.getPositionVec();
Vector3d targetPoint = targetPos.add(0, target.getHeight() / 2, 0);
Vector3d directionVec = targetPoint.subtract(eyePos).normalize();
float baseYaw = (float) Math.toDegrees(Math.atan2(-directionVec.x, directionVec.z));
float basePitch = (float) MathHelper.clamp(
-Math.toDegrees(Math.atan2(directionVec.y, Math.hypot(directionVec.x, directionVec.z))),
MIN_PITCH, MAX_PITCH
);
boolean attacking = false;
if (isAttack) tick = 4;
if (tick > 0) {
attacking = true;
tick--;
}
float yawJitter = 0;
float pitchJitter = 0;
if (!attacking) {
yawJitter = (float) (random.nextGaussian() * 0.3);
pitchJitter = (float) (random.nextGaussian() * 0.2);
}
float attackShift = 0;
if (attacking) {
attackShift = (float) (random.nextGaussian() * 0.5);
}
float finalYaw = baseYaw + yawJitter + attackShift;
float finalPitch = basePitch + pitchJitter + attackShift;
finalPitch = MathHelper.clamp(finalPitch, -90f, 90f);
Rotation newRotation = new Rotation(finalYaw, finalPitch);
float yawChangeSpeed = Mathf.randomValue(45, 65);
float pitchChangeSpeed = Mathf.randomValue(25, 45);
RotationComponent.update(
newRotation,
yawChangeSpeed,
pitchChangeSpeed,
Mathf.randomValue(15, 25),
Mathf.randomValue(8, 15),
0,
15,
false
);
}
public void rotationAggressive(LivingEntity target, boolean isAttack, float attackDistance, boolean check) {
if (target == null || mc.player == null) return;
Vector3d eyePos = mc.player.getEyePosition(mc.getRenderPartialTicks());
Vector3d targetPos = target.getPositionVec();
Vector3d targetPoint = targetPos.add(0, target.getHeight() * 0.85, 0);
Vector3d directionVec = targetPoint.subtract(eyePos).normalize();
float baseYaw = (float) Math.toDegrees(Math.atan2(-directionVec.x, directionVec.z));
float basePitch = (float) MathHelper.clamp(
-Math.toDegrees(Math.atan2(directionVec.y, Math.hypot(directionVec.x, directionVec.z))),
MIN_PITCH, MAX_PITCH
);
boolean attacking = false;
if (isAttack) tick = 3;
if (tick > 0) {
attacking = true;
tick--;
}
float yawJitter = (float) (random.nextGaussian() * 0.2);
float pitchJitter = (float) (random.nextGaussian() * 0.15);
float attackShift = attacking ? (float) (random.nextGaussian() * 0.3) : 0;
float finalYaw = baseYaw + yawJitter + attackShift;
float finalPitch = basePitch + pitchJitter + attackShift;
finalPitch = MathHelper.clamp(finalPitch, -90f, 90f);
Rotation newRotation = new Rotation(finalYaw, finalPitch);
float yawChangeSpeed = Mathf.randomValue(60, 85);
float pitchChangeSpeed = Mathf.randomValue(35, 60);
RotationComponent.update(
newRotation,
yawChangeSpeed,
pitchChangeSpeed,
Mathf.randomValue(20, 30),
Mathf.randomValue(10, 20),
0,
18,
false
);
}
public void reset() {
tick = 0;
}
}
помогите пожалуйста голову отводит зачем то на прицел помогите пж