Начинающий
- Статус
- Оффлайн
- Регистрация
- 3 Дек 2025
- Сообщения
- 139
- Реакции
- 0
- Выберите загрузчик игры
- Fabric
пробую короче чето писать, а не вайбкодить, и это оказывается не так сложна и интересна
самая моя первая ротка
SS -
самая моя первая ротка
Java:
package xentrix.system.modulesystem.impl.rage.killaura.rotation.angle.packet;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.Vec3d;
import xentrix.Initialization;
import xentrix.system.modulesystem.impl.rage.KillAura;
import xentrix.system.modulesystem.impl.rage.killaura.rotation.angle.basic.AngleSmoothMode;
import xentrix.util.math.MathUtils;
import xentrix.util.rotation.angle.Angle;
import xentrix.util.rotation.mod.AngleUtil;
public class TestSmooth extends AngleSmoothMode {
public TestSmooth() {
super("Test");
}
@Override
public Angle limitAngleChange(Angle currentAngle, Angle targetAngle, Vec3d vec3d, Entity entity) {
boolean hasEntity = entity != null;
Angle angleDelta = AngleUtil.calculateDelta(currentAngle, targetAngle);
float yawDelta = angleDelta.getYaw();
float pitchDelta = angleDelta.getPitch();
boolean canAttack = hasEntity && Initialization.getInstance().getManager().getAttackPerpetrator().getAttackHandler().canAttack(KillAura.getInstance().getConfig(), 0);
float rotationDifference = (float) Math.max(Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta)), 0.0001f);
//шатлгбт сдилай топ бупас пж
float baseSpeedYaw = MathUtils.randomLerp(45f, 67f);
float baseSpeedPitch = MathUtils.randomLerp(10f, 25f);
float wave1 = (float) (Math.sin(System.currentTimeMillis() / 60D) * 5.0);
float wave2 = (float) (Math.cos(System.currentTimeMillis() / 50D) * 4.0);
float wave3 = (float) (Math.sin(System.currentTimeMillis() / 70D) * 3.0);
if (rotationDifference < 10) {
baseSpeedYaw *= (rotationDifference / 10f);
baseSpeedPitch *= (rotationDifference / 10f);
}
float straightLineYaw = Math.abs(yawDelta / rotationDifference) * baseSpeedYaw;
float straightLinePitch = Math.abs(pitchDelta / rotationDifference) * baseSpeedPitch;
//че
float yawNoise = 0;
float pitchNoise = 0;
if (hasEntity) {
float waveMultiplier = canAttack ? 0.15f : 1.0f;
float jitterYaw = canAttack ? MathUtils.randomLerp(-0.5f, 0.5f) : MathUtils.randomLerp(-1.5f, 1.5f);
float jitterPitch = canAttack ? MathUtils.randomLerp(-0.5f, 0.5f) : MathUtils.randomLerp(-1.5f, 1.5f);
yawNoise = ((wave1 + wave3) * waveMultiplier) + jitterYaw;
pitchNoise = (wave2 * waveMultiplier) + jitterPitch;
if (!Initialization.getInstance().getManager().getAttackPerpetrator().getAttackHandler().getAttackTimer().finished(250)) {
pitchNoise += -1.5f;
}
}
//лгбт нококал интерпаляцией
float desiredYaw = currentAngle.getYaw() + Math.min(Math.max(yawDelta, -straightLineYaw), straightLineYaw) + yawNoise;
float desiredPitch = currentAngle.getPitch() + Math.min(Math.max(pitchDelta, -straightLinePitch), straightLinePitch) + pitchNoise;
float finalYaw = MathUtils.interpolate(currentAngle.getYaw(), desiredYaw, 0.6f);
float finalPitch = MathUtils.interpolate(currentAngle.getPitch(), desiredPitch, 0.6f);
return new Angle(finalYaw, finalPitch);
}
@Override
public Vec3d randomValue() {
return Vec3d.ZERO;
}
}
SS -
Пожалуйста, авторизуйтесь для просмотра ссылки.