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

Вопрос Что не так с ротацией

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
5 Янв 2023
Сообщения
48
Реакции
0
вроде mx не флагает но на спуки банит быстро


gpt code:
Expand Collapse Copy
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;
    }
}
 
вроде mx не флагает но на спуки банит быстро


gpt code:
Expand Collapse Copy
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;
    }
}
Ну мб потому что в риче говно система роток с которой ты ничего не обойдешь?
 
Ну мб потому что в риче говно система роток с которой ты ничего не обойдешь?
там можно сделать
вроде mx не флагает но на спуки банит быстро


gpt code:
Expand Collapse Copy
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;
    }
}
не пробовал менял ротку?
 
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 double curDiffX = 0;
private double curDiffY = 0;
private double curDiffZ = 0;
private int targetTick = 0;

public SPAngle() {
super("SpookyTime");
}

@override
public Angle limitAngleChange(Angle currentAngle, Angle targetAngle, Vec3d vec3d, Entity entity) {
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 aimPoint = getAimPoint(entity);
Angle calculated = MathAngle.calculateAngle(aimPoint);

float targetYaw = calculated.getYaw();
float targetPitch = MathHelper.clamp(calculated.getPitch(), -90f, 90f);

float yawDiff = MathHelper.wrapDegrees(targetYaw - lastYaw);
float pitchDiff = targetPitch - lastPitch;

float dist = mc.player.getDistance(entity);
float speedMod = MathHelper.clamp(1.0f / dist, 0.5f, 1.2f);

float accelYaw = yawDiff * (0.15f + random.nextFloat() * 0.15f) * speedMod;
float accelPitch = pitchDiff * (0.12f + random.nextFloat() * 0.12f) * speedMod;

float friction = 0.75f + random.nextFloat() * 0.15f;
velocityYaw = velocityYaw * friction + accelYaw;
velocityPitch = velocityPitch * friction + accelPitch;

float newYaw = lastYaw + velocityYaw;
float newPitch = MathHelper.clamp(lastPitch + velocityPitch, -90f, 90f);

double gcd = MathUtils.computeGcd();
newYaw = (float) (lastYaw + Math.round((newYaw - lastYaw) / gcd) * gcd);
newPitch = (float) (lastPitch + Math.round((newPitch - lastPitch) / gcd) * gcd);

if (Math.abs(newYaw - lastYaw) < 0.001f && Math.abs(newPitch - lastPitch) < 0.001f) {
newYaw = lastYaw;
newPitch = lastPitch;
}

lastYaw = newYaw;
lastPitch = newPitch;

return new Angle(newYaw, newPitch);
}

private Vec3d getAimPoint(Entity entity) {
var box = entity.getBoundingBox();

targetTick--;
if (targetTick <= 0) {
targetTick = 5 + random.nextInt(10);
curDiffX = (random.nextDouble() - 0.5) * box.getLengthX() * 0.6;
curDiffZ = (random.nextDouble() - 0.5) * box.getLengthZ() * 0.6;
curDiffY = (random.nextDouble() - 0.5) * box.getLengthY() * 0.4;
}

double centerX = (box.minX + box.maxX) / 2.0;
double centerZ = (box.minZ + box.maxZ) / 2.0;
double centerY = box.minY + box.getLengthY() * 0.6;

return new Vec3d(centerX + curDiffX, centerY + curDiffY, centerZ + curDiffZ);
}

@override
public Vec3d randomValue() {
return Vec3d.ZERO;
}
}
пробуй
 
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 double curDiffX = 0;
private double curDiffY = 0;
private double curDiffZ = 0;
private int targetTick = 0;

public SPAngle() {
super("SpookyTime");
}

@override
public Angle limitAngleChange(Angle currentAngle, Angle targetAngle, Vec3d vec3d, Entity entity) {
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 aimPoint = getAimPoint(entity);
Angle calculated = MathAngle.calculateAngle(aimPoint);

float targetYaw = calculated.getYaw();
float targetPitch = MathHelper.clamp(calculated.getPitch(), -90f, 90f);

float yawDiff = MathHelper.wrapDegrees(targetYaw - lastYaw);
float pitchDiff = targetPitch - lastPitch;

float dist = mc.player.getDistance(entity);
float speedMod = MathHelper.clamp(1.0f / dist, 0.5f, 1.2f);

float accelYaw = yawDiff * (0.15f + random.nextFloat() * 0.15f) * speedMod;
float accelPitch = pitchDiff * (0.12f + random.nextFloat() * 0.12f) * speedMod;

float friction = 0.75f + random.nextFloat() * 0.15f;
velocityYaw = velocityYaw * friction + accelYaw;
velocityPitch = velocityPitch * friction + accelPitch;

float newYaw = lastYaw + velocityYaw;
float newPitch = MathHelper.clamp(lastPitch + velocityPitch, -90f, 90f);

double gcd = MathUtils.computeGcd();
newYaw = (float) (lastYaw + Math.round((newYaw - lastYaw) / gcd) * gcd);
newPitch = (float) (lastPitch + Math.round((newPitch - lastPitch) / gcd) * gcd);

if (Math.abs(newYaw - lastYaw) < 0.001f && Math.abs(newPitch - lastPitch) < 0.001f) {
newYaw = lastYaw;
newPitch = lastPitch;
}

lastYaw = newYaw;
lastPitch = newPitch;

return new Angle(newYaw, newPitch);
}

private Vec3d getAimPoint(Entity entity) {
var box = entity.getBoundingBox();

targetTick--;
if (targetTick <= 0) {
targetTick = 5 + random.nextInt(10);
curDiffX = (random.nextDouble() - 0.5) * box.getLengthX() * 0.6;
curDiffZ = (random.nextDouble() - 0.5) * box.getLengthZ() * 0.6;
curDiffY = (random.nextDouble() - 0.5) * box.getLengthY() * 0.4;
}

double centerX = (box.minX + box.maxX) / 2.0;
double centerZ = (box.minZ + box.maxZ) / 2.0;
double centerY = box.minY + box.getLengthY() * 0.6;

return new Vec3d(centerX + curDiffX, centerY + curDiffY, centerZ + curDiffZ);
}

@override
public Vec3d randomValue() {
return Vec3d.ZERO;
}
}
пробуй
она голову еле еле поворачивает
 
она голову еле еле поворачивает
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 double curDiffX = 0;
private double curDiffY = 0;
private double curDiffZ = 0;
private int targetTick = 0;

public SPAngle() {
super("SpookyTime");
}

@override
public Angle limitAngleChange(Angle currentAngle, Angle targetAngle, Vec3d vec3d, Entity entity) {
if (entity == null) {
lastEntity = null;
velocityYaw = 0;
velocityPitch = 0;
return currentAngle;
}

if (entity != lastEntity) {
lastYaw = mc.player.rotationYaw;
lastPitch = mc.player.rotationPitch;
velocityYaw = 0;
velocityPitch = 0;
lastEntity = entity;
}

Vec3d aimPoint = getAimPoint(entity);
Angle calculated = MathAngle.calculateAngle(aimPoint);

float targetYaw = calculated.getYaw();
float targetPitch = MathHelper.clamp(calculated.getPitch(), -90f, 90f);

float yawDiff = MathHelper.wrapDegrees(targetYaw - lastYaw);
float pitchDiff = targetPitch - lastPitch;

float softness = 0.35f + (random.nextFloat() * 0.2f);
float accelYaw = yawDiff * softness;
float accelPitch = pitchDiff * softness;

float friction = 0.25f + (random.nextFloat() * 0.15f);
velocityYaw = (velocityYaw * friction + accelYaw);
velocityPitch = (velocityPitch * friction + accelPitch);

float maxStep = 45.0f;
velocityYaw = MathHelper.clamp(velocityYaw, -maxStep, maxStep);
velocityPitch = MathHelper.clamp(velocityPitch, -maxStep, maxStep);

float newYaw = lastYaw + velocityYaw;
float newPitch = MathHelper.clamp(lastPitch + velocityPitch, -90f, 90f);

double gcd = MathUtils.computeGcd();
if (gcd != 0) {
newYaw = (float) (lastYaw + Math.round((newYaw - lastYaw) / gcd) * gcd);
newPitch = (float) (lastPitch + Math.round((newPitch - lastPitch) / gcd) * gcd);
}

if (Math.abs(yawDiff) < 0.05f) {
newYaw = lastYaw + (yawDiff * 0.1f);
}

lastYaw = newYaw;
lastPitch = newPitch;

return new Angle(newYaw, newPitch);
}

private Vec3d getAimPoint(Entity entity) {
var box = entity.getBoundingBox();

targetTick--;
if (targetTick <= 0) {
targetTick = 8 + random.nextInt(12);
double rangeX = box.getLengthX() * 0.3;
double rangeZ = box.getLengthZ() * 0.3;
double rangeY = box.getLengthY() * 0.2;

curDiffX = (random.nextDouble() - 0.5) * rangeX;
curDiffZ = (random.nextDouble() - 0.5) * rangeZ;
curDiffY = (random.nextDouble() - 0.5) * rangeY;
}

double centerX = (box.minX + box.maxX) / 2.0;
double centerZ = (box.minZ + box.maxZ) / 2.0;
double centerY = box.minY + (box.getLengthY() * 0.55);

return new Vec3d(centerX + curDiffX, centerY + curDiffY, centerZ + curDiffZ);
}

@override
public Vec3d randomValue() {
return Vec3d.ZERO;
}
}
по идее должно быть быстрее и безопаснее тестируй
 
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 double curDiffX = 0;
private double curDiffY = 0;
private double curDiffZ = 0;
private int targetTick = 0;

public SPAngle() {
super("SpookyTime");
}

@override
public Angle limitAngleChange(Angle currentAngle, Angle targetAngle, Vec3d vec3d, Entity entity) {
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 aimPoint = getAimPoint(entity);
Angle calculated = MathAngle.calculateAngle(aimPoint);

float targetYaw = calculated.getYaw();
float targetPitch = MathHelper.clamp(calculated.getPitch(), -90f, 90f);

float yawDiff = MathHelper.wrapDegrees(targetYaw - lastYaw);
float pitchDiff = targetPitch - lastPitch;

float dist = mc.player.getDistance(entity);
float speedMod = MathHelper.clamp(1.0f / dist, 0.5f, 1.2f);

float accelYaw = yawDiff * (0.15f + random.nextFloat() * 0.15f) * speedMod;
float accelPitch = pitchDiff * (0.12f + random.nextFloat() * 0.12f) * speedMod;

float friction = 0.75f + random.nextFloat() * 0.15f;
velocityYaw = velocityYaw * friction + accelYaw;
velocityPitch = velocityPitch * friction + accelPitch;

float newYaw = lastYaw + velocityYaw;
float newPitch = MathHelper.clamp(lastPitch + velocityPitch, -90f, 90f);

double gcd = MathUtils.computeGcd();
newYaw = (float) (lastYaw + Math.round((newYaw - lastYaw) / gcd) * gcd);
newPitch = (float) (lastPitch + Math.round((newPitch - lastPitch) / gcd) * gcd);

if (Math.abs(newYaw - lastYaw) < 0.001f && Math.abs(newPitch - lastPitch) < 0.001f) {
newYaw = lastYaw;
newPitch = lastPitch;
}

lastYaw = newYaw;
lastPitch = newPitch;

return new Angle(newYaw, newPitch);
}

private Vec3d getAimPoint(Entity entity) {
var box = entity.getBoundingBox();

targetTick--;
if (targetTick <= 0) {
targetTick = 5 + random.nextInt(10);
curDiffX = (random.nextDouble() - 0.5) * box.getLengthX() * 0.6;
curDiffZ = (random.nextDouble() - 0.5) * box.getLengthZ() * 0.6;
curDiffY = (random.nextDouble() - 0.5) * box.getLengthY() * 0.4;
}

double centerX = (box.minX + box.maxX) / 2.0;
double centerZ = (box.minZ + box.maxZ) / 2.0;
double centerY = box.minY + box.getLengthY() * 0.6;

return new Vec3d(centerX + curDiffX, centerY + curDiffY, centerZ + curDiffZ);
}

@override
public Vec3d randomValue() {
return Vec3d.ZERO;
}
}
пробуй
я список шумов делал которые менялись через время, ну аля как в фт ротке зените но рекод
 
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 double curDiffX = 0;
private double curDiffY = 0;
private double curDiffZ = 0;
private int targetTick = 0;

public SPAngle() {
super("SpookyTime");
}

@override
public Angle limitAngleChange(Angle currentAngle, Angle targetAngle, Vec3d vec3d, Entity entity) {
if (entity == null) {
lastEntity = null;
velocityYaw = 0;
velocityPitch = 0;
return currentAngle;
}

if (entity != lastEntity) {
lastYaw = mc.player.rotationYaw;
lastPitch = mc.player.rotationPitch;
velocityYaw = 0;
velocityPitch = 0;
lastEntity = entity;
}

Vec3d aimPoint = getAimPoint(entity);
Angle calculated = MathAngle.calculateAngle(aimPoint);

float targetYaw = calculated.getYaw();
float targetPitch = MathHelper.clamp(calculated.getPitch(), -90f, 90f);

float yawDiff = MathHelper.wrapDegrees(targetYaw - lastYaw);
float pitchDiff = targetPitch - lastPitch;

float softness = 0.35f + (random.nextFloat() * 0.2f);
float accelYaw = yawDiff * softness;
float accelPitch = pitchDiff * softness;

float friction = 0.25f + (random.nextFloat() * 0.15f);
velocityYaw = (velocityYaw * friction + accelYaw);
velocityPitch = (velocityPitch * friction + accelPitch);

float maxStep = 45.0f;
velocityYaw = MathHelper.clamp(velocityYaw, -maxStep, maxStep);
velocityPitch = MathHelper.clamp(velocityPitch, -maxStep, maxStep);

float newYaw = lastYaw + velocityYaw;
float newPitch = MathHelper.clamp(lastPitch + velocityPitch, -90f, 90f);

double gcd = MathUtils.computeGcd();
if (gcd != 0) {
newYaw = (float) (lastYaw + Math.round((newYaw - lastYaw) / gcd) * gcd);
newPitch = (float) (lastPitch + Math.round((newPitch - lastPitch) / gcd) * gcd);
}

if (Math.abs(yawDiff) < 0.05f) {
newYaw = lastYaw + (yawDiff * 0.1f);
}

lastYaw = newYaw;
lastPitch = newPitch;

return new Angle(newYaw, newPitch);
}

private Vec3d getAimPoint(Entity entity) {
var box = entity.getBoundingBox();

targetTick--;
if (targetTick <= 0) {
targetTick = 8 + random.nextInt(12);
double rangeX = box.getLengthX() * 0.3;
double rangeZ = box.getLengthZ() * 0.3;
double rangeY = box.getLengthY() * 0.2;

curDiffX = (random.nextDouble() - 0.5) * rangeX;
curDiffZ = (random.nextDouble() - 0.5) * rangeZ;
curDiffY = (random.nextDouble() - 0.5) * rangeY;
}

double centerX = (box.minX + box.maxX) / 2.0;
double centerZ = (box.minZ + box.maxZ) / 2.0;
double centerY = box.minY + (box.getLengthY() * 0.55);

return new Vec3d(centerX + curDiffX, centerY + curDiffY, centerZ + curDiffZ);
}

@override
public Vec3d randomValue() {
return Vec3d.ZERO;
}
}
по идее должно быть быстрее и безопаснее тестируй
ротация называется сам наведись
 
ротация называется сам наведись
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 double curDiffX = 0;
private double curDiffY = 0;
private double curDiffZ = 0;
private int targetTick = 0;

public SPAngle() {
super("SpookyTime");
}

@override
public Angle limitAngleChange(Angle currentAngle, Angle targetAngle, Vec3d vec3d, Entity entity) {
if (entity == null) {
lastEntity = null;
velocityYaw = 0;
velocityPitch = 0;
return currentAngle;
}

if (entity != lastEntity) {
lastYaw = mc.player.rotationYaw;
lastPitch = mc.player.rotationPitch;
velocityYaw = 0;
velocityPitch = 0;
lastEntity = entity;
}

Vec3d aimPoint = getAimPoint(entity);
Angle calculated = MathAngle.calculateAngle(aimPoint);

float targetYaw = calculated.getYaw();
float targetPitch = MathHelper.clamp(calculated.getPitch(), -90f, 90f);

float yawDiff = MathHelper.wrapDegrees(targetYaw - lastYaw);
float pitchDiff = targetPitch - lastPitch;

float softness = 0.55f + (random.nextFloat() * 0.25f);
float accelYaw = yawDiff * softness;
float accelPitch = pitchDiff * softness;

float friction = 0.35f + (random.nextFloat() * 0.2f);
velocityYaw = (velocityYaw * friction + accelYaw);
velocityPitch = (velocityPitch * friction + accelPitch);

float maxStep = 85.0f;
velocityYaw = MathHelper.clamp(velocityYaw, -maxStep, maxStep);
velocityPitch = MathHelper.clamp(velocityPitch, -maxStep, maxStep);

float newYaw = lastYaw + velocityYaw;
float newPitch = MathHelper.clamp(lastPitch + velocityPitch, -90f, 90f);

double gcd = MathUtils.computeGcd();
if (gcd != 0) {
newYaw = (float) (lastYaw + Math.round((newYaw - lastYaw) / gcd) * gcd);
newPitch = (float) (lastPitch + Math.round((newPitch - lastPitch) / gcd) * gcd);
}

if (Math.abs(yawDiff) < 0.5f) {
newYaw = lastYaw + (yawDiff * 0.5f);
}

lastYaw = newYaw;
lastPitch = newPitch;

return new Angle(newYaw, newPitch);
}

private Vec3d getAimPoint(Entity entity) {
var box = entity.getBoundingBox();

targetTick--;
if (targetTick <= 0) {
targetTick = 4 + random.nextInt(8);
double rangeX = box.getLengthX() * 0.3;
double rangeZ = box.getLengthZ() * 0.3;
double rangeY = box.getLengthY() * 0.2;

curDiffX = (random.nextDouble() - 0.5) * rangeX;
curDiffZ = (random.nextDouble() - 0.5) * rangeZ;
curDiffY = (random.nextDouble() - 0.5) * rangeY;
}

double centerX = (box.minX + box.maxX) / 2.0;
double centerZ = (box.minZ + box.maxZ) / 2.0;
double centerY = box.minY + (box.getLengthY() * 0.55);

return new Vec3d(centerX + curDiffX, centerY + curDiffY, centerZ + curDiffZ);
}

@override
public Vec3d randomValue() {
return Vec3d.ZERO;
}
}
теперь не сама наведись, попробуй
 
Назад
Сверху Снизу