Начинающий
- Статус
- Оффлайн
- Регистрация
- 19 Янв 2023
- Сообщения
- 31
- Реакции
- 1
- Выберите загрузчик игры
- Vanilla
- Прочие моды
Эта ротация была сделана +- за 5 минут (60 строчек), обходит куча серверов где ач Intave, по типу gulpvp, prostotrainer
желательно ставьте 65 и 40 скорость
ss:
дальше идут утилиты которые юзались в мейнкоде ->
желательно ставьте 65 и 40 скорость
ss:
rotation!:
public class MetaRotation extends RotationMode {
Slider speedX = new Slider(this, "Скорость X").min(45).max(80).inc(1).set(65);
Slider speedY = new Slider(this, "Скорость Y").min(40).max(60).inc(1).set(40);
CheckBox falling = new CheckBox(this, "Ускорять, если падаешь");
public MetaRotation(Mode parent) {
super(parent, "Новая");
}
RotationAnimation interp = new RotationAnimation();
@Override
public void update(LivingEntity target) {
Aura aura = Modules.get(Aura.class);
interp.easing(Easing.SMOOTH_STEP);
Vector3d pos = mc.player.getEyePosition(0).add(aura.getOffX() * 0.05, -aura.getOffY() * 0.05, 0);
Vector3d multipoint = new Vector3d(
MathHelper.clamp(pos.x, target.getBoundingBox().minX, target.getBoundingBox().maxX),
MathHelper.clamp(pos.y, target.getBoundingBox().minY, target.getBoundingBox().maxY),
MathHelper.clamp(pos.z, target.getBoundingBox().minZ, target.getBoundingBox().maxZ)
);
Vector2f base = Rotation.get(aura.getMPoints() ? multipoint : target.getEyePosition(0).add(aura.getOffX() * 0.05, -aura.getOffY() * 0.05, 0));
float yaw = interp.getYaw() + Rotation.shorten(base.x, interp.getYaw()),
speed = AuraUtil.getSens(MathUtil.random(0.6f, 0.9f)),
test = AuraUtil.getSens(MathUtil.random(100, 135));
float baseSpeed = (170 - speedX.get()) * speed;
boolean check = Player.collide(target) && (Player.silent(target)
|| Player.getBlock(0, 2, 0) != Blocks.AIR && Player.getBlock(0, -1, 0)
!= Blocks.AIR && Player.getBlock(0, 2, 0) != Blocks.WATER && Player.getBlock(0, -1, 0) != Blocks.WATER),
look = MathUtil.rayTraceWithBlock(aura.range.get() - 1, interp.getYaw(), interp.getPitch(), mc.player, target, false);
// Ускорения
if (!look) baseSpeed *= 0.87f;
// Поворачиваем на центр, если падаем
if (falling.get()) yaw += mc.player.fallDistance * MathHelper.wrapDegrees(base.x - rotation.x) * 3.5f;
Vector2f angles = new Vector2f(yaw, base.y);
if (angles.y > 0) angles.y += MathUtil.random(-0.826f, 0.459f);
float rayCaster = look ? 2.7f : 1f;
// Замедления
if (Player.collide(target, -0.4f)) {
baseSpeed *= 1.4f;
angles.y = 85; // Смотрим вниз, ведь мы уже в цели
}
// Замедляем, если цель в блоках
if (check) baseSpeed *= 1.35f;
rotation = interp.animate(angles, (int) (baseSpeed) - 35, ((int) (test - speedY.get()) * (int) rayCaster) - 35);
}
}
дальше идут утилиты которые юзались в мейнкоде ->
AuraUtil.java:
public class AuraUtil {
public static float getSens(float rotation) {
return getDeltaMouse(rotation) * Rotation.getGCD();
}
public static float getDeltaMouse(float delta) {
return Math.round(delta / Rotation.getGCD());
}
}
Player:
public class Player {
public static Block getBlock() {
return getBlock(0, 0, 0);
}
public static Block getBlock(double x, double y, double z) {
return mc.world.getBlockState(mc.player.getPosition().add(x, y, z)).getBlock();
}
public static boolean silent(LivingEntity target) {
Vector3d pos = target.getPositionVec();
AxisAlignedBB hitbox = target.getBoundingBox();
float off = 0.05f;
return !isAir(hitbox.minX-off, pos.y, hitbox.minZ-off)
|| !isAir(hitbox.maxX+off, pos.y, hitbox.minZ-off)
|| !isAir(hitbox.minX-off, pos.y, hitbox.maxZ+off)
|| !isAir(hitbox.maxX+off, pos.y, hitbox.maxZ+off);
}
public static boolean isAir(double x, double y, double z) { return mc.world.getBlockState(new BlockPos(x, y, z)).getBlock() == Blocks.AIR; }
}
public static boolean collide(LivingEntity entity) {
return collide(entity, 0);
}
public static boolean collide(LivingEntity entity, float grow) {
AxisAlignedBB box = mc.player.getBoundingBox();
AxisAlignedBB targetbox = entity.getBoundingBox().grow(grow, 0, grow);
if (box.maxX > targetbox.minX
&& box.maxY > targetbox.minY && box.maxZ > targetbox.minZ
&& box.minX < targetbox.maxX && box.minY < targetbox.maxY
&& box.minZ < targetbox.maxZ) return true;
return false;
}
RotationUtil:
public class Rotation {
public static Vector2f vector(Vector3d vec) {
Vector3d eyesPos = mc.player.getEyePosition(1.0f);
double diffX = vec != null ? vec.x - eyesPos.x : 0;
double diffY = vec != null ? vec.y - (mc.player.getPosY() + (double) mc.player.getEyeHeight() + 0.5) : 0;
double diffZ = vec != null ? vec.z - eyesPos.z : 0;
double diffXZ = Math.sqrt(diffX * diffX + diffZ * diffZ);
float yaw = (float) (Math.toDegrees(Math.atan2(diffZ, diffX)) - 90.0);
float pitch = (float) (-Math.toDegrees(Math.atan2(diffY, diffXZ)));
yaw = mc.player.rotationYaw + MathHelper.wrapDegrees(yaw - mc.player.rotationYaw);
pitch = mc.player.rotationPitch + MathHelper.wrapDegrees(pitch - mc.player.rotationPitch);
pitch = MathHelper.clamp(pitch, -90.0f, 90.0f);
return new Vector2f(yaw, pitch);
}
public static float shorten(float degree) {
return (float) (((((mc.player.rotationYaw - degree) % 360) + 540) % 360) - 180);
}
public static float shorten(float degree1, float degree2) {
return (float) (((((degree1 - degree2) % 360) + 540) % 360) - 180);
}
public static Vector2f get(Vector3d target) {
Vector3d eyesPos = new Vector3d(mc.player.getPosX(), mc.player.getPosY() + mc.player.getEyeHeight(), mc.player.getPosZ());
double diffX = target.x - eyesPos.x;
double diffY = target.y - eyesPos.y;
double diffZ = target.z - eyesPos.z;
double diffXZ = MathHelper.sqrt(diffX * diffX + diffZ * diffZ);
float yaw = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(diffZ, diffX)) - 90.0f);
float pitch = (float) MathHelper.clamp(-Math.toDegrees(Math.atan2(diffY, diffXZ)), -89, 89);
float sens = (float) (Math.pow(mc.gameSettings.mouseSensitivity, 1.5) * 0.05f + 0.1f);
float pow = sens * sens * sens * 1.2F;
yaw -= yaw % pow;
pitch -= pitch % (pow * sens);
return new Vector2f(yaw, pitch);
}
public static Vector2f gcd(float yaw, float pitch) {
float gcd = getGCD();
yaw -= yaw % gcd;
pitch -= pitch % gcd;
return new Vector2f(yaw, pitch);
}
public static float getGCD() {
double realGcd = mc.gameSettings.mouseSensitivity;
double d4 = realGcd * (double) 0.6F + (double) 0.2F;
return (float) (d4 * d4 * d4 * 8.0D * 0.15);
}
}
Последнее редактирование модератором:
