вроде mx не флагает но на спуки банит быстро
gpt code:
package rich.modules.impl.combat.aura.rotations;
import rich.Initialization;
import rich.IMinecraft;
import rich.modules.impl.combat.Aura;
import rich.modules.impl.combat.aura.Angle;
import rich.modules.impl.combat.aura.MathAngle;
import rich.modules.impl.combat.aura.attack.StrikeManager;
import rich.modules.impl.combat.aura.impl.RotateConstructor;
import rich.util.math.MathUtils;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import java.util.Random;
public class SPAngle extends RotateConstructor implements IMinecraft {
private final Random random = new Random();
private float lastYaw = 0;
private float lastPitch = 0;
private Entity lastEntity = null;
private float velocityYaw = 0;
private float velocityPitch = 0;
private float tremorYaw = 0;
private float tremorPitch = 0;
private int tremorTickYaw = 0;
private int tremorTickPitch = 0;
private float aimOffsetX = 0;
private float aimOffsetY = 0;
private float aimOffsetZ = 0;
private int aimOffsetTick = 0;
public SPAngle() {
super("SpookyTime");
}
@Override
public Angle limitAngleChange(Angle currentAngle, Angle targetAngle, Vec3d vec3d, Entity entity) {
StrikeManager attackHandler = Initialization.getInstance().getManager().getAttackPerpetrator().getAttackHandler();
Aura aura = Aura.getInstance();
if (entity == null) {
lastEntity = null;
velocityYaw = 0;
velocityPitch = 0;
return currentAngle;
}
if (entity != lastEntity) {
lastYaw = currentAngle.getYaw();
lastPitch = currentAngle.getPitch();
velocityYaw = 0;
velocityPitch = 0;
lastEntity = entity;
}
Vec3d eyes = mc.player.getEyePos();
Vec3d aimPoint = getAimPoint(entity);
float distToTarget = (float) eyes.distanceTo(aimPoint);
Angle angle = MathAngle.calculateAngle(aimPoint);
float targetYaw = angle.getYaw();
float targetPitch = MathHelper.clamp(angle.getPitch(), -90f, 90f);
float yawDiff = MathHelper.wrapDegrees(targetYaw - lastYaw);
float pitchDiff = targetPitch - lastPitch;
if (Math.abs(yawDiff) > 280) {
yawDiff = MathHelper.clamp(yawDiff, -280, 280);
}
float n1 = random.nextFloat();
float n2 = random.nextFloat();
float n3 = random.nextFloat();
float distanceFactor;
if (distToTarget < 2.0f) {
distanceFactor = 0.8f + n1 * 0.4f;
} else if (distToTarget < 4.0f) {
distanceFactor = 1.2f + n2 * 0.6f;
} else {
distanceFactor = 0.9f + n3 * 0.5f;
}
float targetVelYaw = yawDiff * (0.45f + n1 * 0.25f) * distanceFactor;
float targetVelPitch = pitchDiff * (0.35f + n2 * 0.20f) * distanceFactor;
float inertiaYaw = 0.50f + random.nextFloat() * 0.25f;
float inertiaPitch = 0.50f + random.nextFloat() * 0.25f;
velocityYaw = velocityYaw * (1f - inertiaYaw) + targetVelYaw * inertiaYaw;
velocityPitch = velocityPitch * (1f - inertiaPitch) + targetVelPitch * inertiaPitch;
if (random.nextFloat() < 0.02f) velocityYaw += (random.nextFloat() - 0.5f) * 1.5f;
if (random.nextFloat() < 0.02f) velocityPitch += (random.nextFloat() - 0.5f) * 1.2f;
if (random.nextFloat() < 0.04f && Math.abs(yawDiff) > 5.0f) {
velocityYaw *= 1.1f + random.nextFloat() * 0.25f;
}
tremorTickYaw--;
if (tremorTickYaw <= 0) {
tremorTickYaw = 2 + random.nextInt(5);
tremorYaw = (random.nextFloat() - 0.5f) * 0.12f;
}
tremorTickPitch--;
if (tremorTickPitch <= 0) {
tremorTickPitch = 2 + random.nextInt(5);
tremorPitch = (random.nextFloat() - 0.5f) * 0.10f;
}
float newYaw = lastYaw + velocityYaw + tremorYaw;
float newPitch = MathHelper.clamp(lastPitch + velocityPitch + tremorPitch, -90f, 90f);
double gcd = MathUtils.computeGcd();
newYaw = newYaw - (float) ((newYaw - lastYaw) % gcd);
newPitch = newPitch - (float) ((newPitch - lastPitch) % gcd);
if (Math.abs(newYaw - lastYaw) < 0.01f && Math.abs(newPitch - lastPitch) < 0.01f) {
newYaw = lastYaw;
newPitch = lastPitch;
}
lastYaw = newYaw;
lastPitch = newPitch;
return new Angle(newYaw, newPitch);
}
private Vec3d getAimPoint(Entity entity) {
var box = entity.getBoundingBox();
double hw = box.getLengthX() * 0.3;
double hd = box.getLengthZ() * 0.3;
aimOffsetTick--;
if (aimOffsetTick <= 0) {
aimOffsetTick = 4 + random.nextInt(8);
aimOffsetX = (float) ((random.nextFloat() - 0.5f) * hw * 2);
aimOffsetZ = (float) ((random.nextFloat() - 0.5f) * hd * 2);
aimOffsetY = (float) (random.nextGaussian() * box.getLengthY() * 0.08f);
}
double cx = (box.minX + box.maxX) / 2.0 + aimOffsetX;
double cz = (box.minZ + box.maxZ) / 2.0 + aimOffsetZ;
double cy = box.minY + box.getLengthY() * MathHelper.clamp(0.65f + aimOffsetY, 0.35f, 0.95f);
return new Vec3d(cx, cy, cz);
}
@Override
public Vec3d randomValue() {
return Vec3d.ZERO;
}
}