Fabric 1.20.4 Aura

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
25 Янв 2024
Сообщения
519
Реакции
3
Слив горе-килки
Java:
Expand Collapse Copy
package ru.prodlasio.feature.in.combat;

import lombok.Getter;
import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.decoration.ArmorStandEntity;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.RaycastContext;
import ru.prodlasio.event.Subscriber;
import ru.prodlasio.event.impl.player.EventPlayerJump;
import ru.prodlasio.event.impl.player.EventPlayerTravel;
import ru.prodlasio.event.impl.player.EventSync;
import ru.prodlasio.event.impl.player.UpdateEvent;
import ru.prodlasio.event.impl.render.EventRender3D;
import ru.prodlasio.feature.Feature;
import ru.prodlasio.feature.settings.impl.BooleanSetting;
import ru.prodlasio.feature.settings.impl.ModeSetting;
import ru.prodlasio.helper.main.manager.FriendManager;
import ru.prodlasio.helper.other.math.MathUtil;
import ru.prodlasio.helper.other.player.MovementFix;
import ru.prodlasio.helper.other.player.PlayerHandler;
import ru.prodlasio.helper.other.player.Rotations;
import ru.prodlasio.helper.main.render.TargerRender;
import ru.prodlasio.feature.Category;
import ru.prodlasio.feature.settings.impl.SliderSetting;

import java.util.Comparator;
import java.util.stream.StreamSupport;

public class Aura extends Feature {
    public Aura() {
        super(Category.COMBAT);
        add(range,onlyCrits,rotation,noAttackWenUsingItem,attackWals);
    }

    @Getter
    public static SliderSetting range = new SliderSetting("Дистанция",3,1,6,0.1F);
    public final BooleanSetting onlyCrits = new BooleanSetting("Только криты", true);
    public final BooleanSetting noAttackWenUsingItem = new BooleanSetting("Не бить при исп.", true);
    public final BooleanSetting attackWals = new BooleanSetting("Бить через стены", true);
    public final ModeSetting rotation = new ModeSetting("Ротация","Обычная","Обычная","Фт");
    @Getter
    public static Entity target;
    private Vec3d rotationPoint = Vec3d.ZERO, rotationMotion = Vec3d.ZERO;

    @Subscriber
    public void onEvent(UpdateEvent e) {
        auraLogic();

        if (mc.player == null) return;
        Rotations.rotate(rotationYaw, rotationPitch);
    }

    @Subscriber
    public void onEvent(EventSync e) {
        if (mc.player == null) return;
        if (target == null) return;

        mc.player.setBodyYaw(rotationYaw);
        mc.player.setHeadYaw(rotationYaw);
        TargerRender.tick();
    }

    @Subscriber
    public void onEventRender(EventRender3D e) {
        if (mc.player == null) return;
        if (target == null) return;

        TargerRender.render((LivingEntity) target);
    }

    @Subscriber
    public void onJump(EventPlayerJump e) {
        if (mc.player == null) return;
        if (target == null) return;
        MovementFix.onJump(e);
    }

    @Subscriber
    public void onMove(EventPlayerTravel e) {
        if (mc.player == null) return;
        if (target == null) return;
        MovementFix.modifyVelocity(e);
    }


    @Getter
    public static float rotationYaw, rotationPitch, pitchAcceleration = 1F;

    @Override
    public void off() {
        target = null;
        resetRotations();
        super.off();
    }

    private void resetRotations() {
        if (mc.player == null) return;
        rotationYaw = mc.player.getYaw();
        rotationPitch = mc.player.getPitch();
    }

    private void auraLogic() {
        target = findTarget();
        if (target == null) {
            resetRotations();
            return;
        }

        if (rotation.is("Обычная")) {
            updateRotations();
        } else {
            ftRotation();
        }
        attackTarget();
    }
    public Vec3d getLegitLook(Entity target) {

        float minMotionXZ = 0.003f;
        float maxMotionXZ = 0.03f;

        float minMotionY = 0.001f;
        float maxMotionY = 0.03f;

        double lenghtX = target.getBoundingBox().getLengthX();
        double lenghtY = target.getBoundingBox().getLengthY();
        double lenghtZ = target.getBoundingBox().getLengthZ();


        // Задаем начальную скорость точки
        if (rotationMotion.equals(Vec3d.ZERO))
            rotationMotion = new Vec3d(MathUtil.random(-0.05f, 0.05f), MathUtil.random(-0.05f, 0.05f), MathUtil.random(-0.05f, 0.05f));

        rotationPoint = rotationPoint.add(rotationMotion);

        // Сталкиваемся с хитбоксом по X
        if (rotationPoint.x >= (lenghtX - 0.05) / 2f)
            rotationMotion = new Vec3d(-MathUtil.random(minMotionXZ, maxMotionXZ), rotationMotion.getY(), rotationMotion.getZ());

        // Сталкиваемся с хитбоксом по Y
        if (rotationPoint.y >= lenghtY)
            rotationMotion = new Vec3d(rotationMotion.getX(), -MathUtil.random(minMotionY, maxMotionY), rotationMotion.getZ());

        // Сталкиваемся с хитбоксом по Z
        if (rotationPoint.z >= (lenghtZ - 0.05) / 2f)
            rotationMotion = new Vec3d(rotationMotion.getX(), rotationMotion.getY(), -MathUtil.random(minMotionXZ, maxMotionXZ));

        // Сталкиваемся с хитбоксом по -X
        if (rotationPoint.x <= -(lenghtX - 0.05) / 2f)
            rotationMotion = new Vec3d(MathUtil.random(minMotionXZ, 0.03f), rotationMotion.getY(), rotationMotion.getZ());

        // Сталкиваемся с хитбоксом по -Y
        if (rotationPoint.y <= 0.05)
            rotationMotion = new Vec3d(rotationMotion.getX(), MathUtil.random(minMotionY, maxMotionY), rotationMotion.getZ());

        // Сталкиваемся с хитбоксом по -Z
        if (rotationPoint.z <= -(lenghtZ - 0.05) / 2f)
            rotationMotion = new Vec3d(rotationMotion.getX(), rotationMotion.getY(), MathUtil.random(minMotionXZ, maxMotionXZ));

        // Добавляем джиттер
        rotationPoint.add(MathUtil.random(-0.03f, 0.03f), 0f, MathUtil.random(-0.03f, 0.03f));

        float[] rotation;

        // Если мы перестали смотреть на цель
        if (!PlayerHandler.checkRtx(rotationYaw, rotationPitch, getAttackRange(), false, true)) {
            float[] rotation1 = PlayerHandler.calcAngle(target.getPos().add(0, target.getEyeHeight(target.getPose()) / 2f, 0));

            // Проверяем видимость центра игрока
            if (PlayerHandler.squaredDistanceFromEyes(target.getPos().add(0, target.getEyeHeight(target.getPose()) / 2f, 0)) <= getAttackRange() * getAttackRange()
                    && PlayerHandler.checkRtx(rotation1[0], rotation1[1], getAttackRange(), false, true)) {
                // наводим на центр
                rotationPoint = new Vec3d(MathUtil.random(-0.1f, 0.1f), target.getEyeHeight(target.getPose()) / (MathUtil.random(1.8f, 2.5f)), MathUtil.random(-0.1f, 0.1f));
            } else {
                // Сканим хитбокс на видимую точку
                float halfBox = (float) (lenghtX / 2f);

                for (float x1 = -halfBox; x1 <= halfBox; x1 += 0.05f) {
                    for (float z1 = -halfBox; z1 <= halfBox; z1 += 0.05f) {
                        for (float y1 = 0.05f; y1 <= target.getBoundingBox().getLengthY(); y1 += 0.15f) {

                            Vec3d v1 = new Vec3d(target.getX() + x1, target.getY() + y1, target.getZ() + z1);

                            // Скипаем, если вне досягаемости
                            if (PlayerHandler.squaredDistanceFromEyes(v1) > getAttackRange() * getAttackRange()) continue;

                            rotation = PlayerHandler.calcAngle(v1);
                            if (PlayerHandler.checkRtx(rotation[0], rotation[1],getAttackRange(), false, true)) {
                                // Наводимся, если видим эту точку
                                rotationPoint = new Vec3d(x1, y1, z1);
                                break;
                            }
                        }
                    }
                }
            }
        }
        return target.getPos().add(rotationPoint);
    }

    private void updateRotations() {
        Vec3d targetVec;

        targetVec = getLegitLook(target);

        pitchAcceleration = mc.player.isFallFlying() ? 90.0F : 8.0F;

        float delta_yaw = net.minecraft.util.math.MathHelper.wrapDegrees((float) net.minecraft.util.math.MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(targetVec.z - mc.player.getZ(), (targetVec.x - mc.player.getX()))) - 90) - rotationYaw);
        float delta_pitch = ((float) (-Math.toDegrees(Math.atan2(targetVec.y - (mc.player.getPos().y + mc.player.getEyeHeight(mc.player.getPose())), Math.sqrt(Math.pow((targetVec.x - mc.player.getX()), 2) + Math.pow(targetVec.z - mc.player.getZ(), 2))))) - rotationPitch);

        float yawStep = MathUtil.random(15, 25);
        float pitchStep = pitchAcceleration + MathUtil.random(-1F, 1F);

        if (delta_yaw > 180)
            delta_yaw = delta_yaw - 180;

        float deltaYaw = net.minecraft.util.math.MathHelper.clamp(net.minecraft.util.math.MathHelper.abs(delta_yaw), -yawStep, yawStep);
        float deltaPitch = net.minecraft.util.math.MathHelper.clamp(delta_pitch, -pitchStep, pitchStep);

        float newYaw = rotationYaw + (delta_yaw > 0 ? deltaYaw : -deltaYaw);
        float newPitch = net.minecraft.util.math.MathHelper.clamp(rotationPitch + deltaPitch, -90.0F, 90.0F);

        double gcdFix = (Math.pow(mc.options.getMouseSensitivity().getValue() * 0.8 + 0.2, 3.0)) * 1.2;

        rotationYaw = (float) (newYaw - (newYaw - rotationYaw) % gcdFix);
        rotationPitch = (float) (newPitch - (newPitch - rotationPitch) % gcdFix);

        MovementFix.rotationYaw = rotationYaw;
        MovementFix.rotationPitch = rotationPitch;
    }


    private void ftRotation() {
        Vec3d targetPos = target.getPos().add(0, target.getHeight() / 2.0, 0);
        Vec3d playerEyePos = mc.player.getEyePos();

        Vec3d difference = targetPos.subtract(playerEyePos);
        double distance = Math.sqrt(difference.x * difference.x + difference.z * difference.z);

        float yaw = (float) (Math.toDegrees(Math.atan2(difference.z, difference.x)) - 90.0);
        float pitch = (float) (-Math.toDegrees(Math.atan2(difference.y, distance)));

        rotationYaw = yaw;
        rotationPitch = pitch;

        MovementFix.rotationYaw = yaw;
        MovementFix.rotationPitch = pitch;
    }

    private Entity findTarget() {
        return (LivingEntity) StreamSupport.stream(mc.world.getEntities().spliterator(), false)
                .filter(entity -> entity instanceof LivingEntity && entity != mc.player && isValid((LivingEntity) entity))
                .min(Comparator.comparing(entity -> entity.squaredDistanceTo(mc.player))).orElse(null);
    }

    private boolean isValid(LivingEntity targetEntity) {
        if (targetEntity == null
                || targetEntity instanceof ArmorStandEntity
                || !targetEntity.isAlive()
                || mc.player.distanceTo(targetEntity) >= getAttackRange()) {
            return false;
        }

        if (RemoveBots.isBot(targetEntity)) {
            return false;
        }

        if (targetEntity instanceof PlayerEntity) {
            PlayerEntity player = (PlayerEntity) targetEntity;
            if (!FriendManager.checkFriend(player.getName().getString()) && !RemoveBots.isBot(targetEntity)) {
                return true;
            }
        }

        if (FriendManager.checkFriend(targetEntity.getName().getString()) && !RemoveBots.isBot(targetEntity)) {
            return false;
        }

        return false;
    }


    private boolean shouldCancelCrit() {
        return !onlyCrits.get()
                || mc.player.getAbilities().flying
                || mc.player.hasStatusEffect(StatusEffects.LEVITATION)
                || mc.player.hasStatusEffect(StatusEffects.BLINDNESS)
                || PlayerHandler.isPlayerInWeb()
                || mc.world.getBlockState(mc.player.getBlockPos()).getBlock() == Blocks.LADDER;
    }
    private boolean canCrit() {
        if (mc.player.getAttackCooldownProgress(0.5f) < 0.9F) return false;

        if (mc.player.isInLava()) return true;

        if (!mc.options.jumpKey.isPressed() && PlayerHandler.isAboveWater()) return true;

        if (!shouldCancelCrit()) return !mc.player.isOnGround() && mc.player.fallDistance > 0.0f;

        return true;
    }


    private void attackTarget() {
        if (mc.player.distanceTo(target) >= getAttackRange()) return;

        if (!canCrit()) return;

        if (mc.player.isUsingItem() && noAttackWenUsingItem.get()) {
            return;
        }

        if (!canSeeTarget() && !attackWals.get()) {
            return;
        }

        mc.interactionManager.attackEntity(mc.player, target);
        mc.player.swingHand(Hand.MAIN_HAND);
    }

    private boolean canSeeTarget() {
        Vec3d playerPos = mc.player.getPos();
        Vec3d targetPos = target.getPos();

        RaycastContext context = new RaycastContext(
                playerPos,
                targetPos,
                RaycastContext.ShapeType.OUTLINE,
                RaycastContext.FluidHandling.NONE,
                mc.player
        );

        HitResult result = mc.world.raycast(context);

        if (result.getType() == HitResult.Type.MISS) {
            return true;
        }
        if (result.getType() == HitResult.Type.BLOCK) {
            return false;
        }
        if (result instanceof EntityHitResult entityHitResult) {
            return entityHitResult.getEntity() == target;
        }

        return false;
    }

    public float getAttackRange() {
        return range.get();
    }
}
 
чуть-чуть минцед аура
 
легит ротация да
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Ыы дай movementfix
 
я не за пк
 
Слив горе-килки
Java:
Expand Collapse Copy
package ru.prodlasio.feature.in.combat;

import lombok.Getter;
import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.decoration.ArmorStandEntity;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.RaycastContext;
import ru.prodlasio.event.Subscriber;
import ru.prodlasio.event.impl.player.EventPlayerJump;
import ru.prodlasio.event.impl.player.EventPlayerTravel;
import ru.prodlasio.event.impl.player.EventSync;
import ru.prodlasio.event.impl.player.UpdateEvent;
import ru.prodlasio.event.impl.render.EventRender3D;
import ru.prodlasio.feature.Feature;
import ru.prodlasio.feature.settings.impl.BooleanSetting;
import ru.prodlasio.feature.settings.impl.ModeSetting;
import ru.prodlasio.helper.main.manager.FriendManager;
import ru.prodlasio.helper.other.math.MathUtil;
import ru.prodlasio.helper.other.player.MovementFix;
import ru.prodlasio.helper.other.player.PlayerHandler;
import ru.prodlasio.helper.other.player.Rotations;
import ru.prodlasio.helper.main.render.TargerRender;
import ru.prodlasio.feature.Category;
import ru.prodlasio.feature.settings.impl.SliderSetting;

import java.util.Comparator;
import java.util.stream.StreamSupport;

public class Aura extends Feature {
    public Aura() {
        super(Category.COMBAT);
        add(range,onlyCrits,rotation,noAttackWenUsingItem,attackWals);
    }

    @Getter
    public static SliderSetting range = new SliderSetting("Дистанция",3,1,6,0.1F);
    public final BooleanSetting onlyCrits = new BooleanSetting("Только криты", true);
    public final BooleanSetting noAttackWenUsingItem = new BooleanSetting("Не бить при исп.", true);
    public final BooleanSetting attackWals = new BooleanSetting("Бить через стены", true);
    public final ModeSetting rotation = new ModeSetting("Ротация","Обычная","Обычная","Фт");
    @Getter
    public static Entity target;
    private Vec3d rotationPoint = Vec3d.ZERO, rotationMotion = Vec3d.ZERO;

    @Subscriber
    public void onEvent(UpdateEvent e) {
        auraLogic();

        if (mc.player == null) return;
        Rotations.rotate(rotationYaw, rotationPitch);
    }

    @Subscriber
    public void onEvent(EventSync e) {
        if (mc.player == null) return;
        if (target == null) return;

        mc.player.setBodyYaw(rotationYaw);
        mc.player.setHeadYaw(rotationYaw);
        TargerRender.tick();
    }

    @Subscriber
    public void onEventRender(EventRender3D e) {
        if (mc.player == null) return;
        if (target == null) return;

        TargerRender.render((LivingEntity) target);
    }

    @Subscriber
    public void onJump(EventPlayerJump e) {
        if (mc.player == null) return;
        if (target == null) return;
        MovementFix.onJump(e);
    }

    @Subscriber
    public void onMove(EventPlayerTravel e) {
        if (mc.player == null) return;
        if (target == null) return;
        MovementFix.modifyVelocity(e);
    }


    @Getter
    public static float rotationYaw, rotationPitch, pitchAcceleration = 1F;

    @Override
    public void off() {
        target = null;
        resetRotations();
        super.off();
    }

    private void resetRotations() {
        if (mc.player == null) return;
        rotationYaw = mc.player.getYaw();
        rotationPitch = mc.player.getPitch();
    }

    private void auraLogic() {
        target = findTarget();
        if (target == null) {
            resetRotations();
            return;
        }

        if (rotation.is("Обычная")) {
            updateRotations();
        } else {
            ftRotation();
        }
        attackTarget();
    }
    public Vec3d getLegitLook(Entity target) {

        float minMotionXZ = 0.003f;
        float maxMotionXZ = 0.03f;

        float minMotionY = 0.001f;
        float maxMotionY = 0.03f;

        double lenghtX = target.getBoundingBox().getLengthX();
        double lenghtY = target.getBoundingBox().getLengthY();
        double lenghtZ = target.getBoundingBox().getLengthZ();


        // Задаем начальную скорость точки
        if (rotationMotion.equals(Vec3d.ZERO))
            rotationMotion = new Vec3d(MathUtil.random(-0.05f, 0.05f), MathUtil.random(-0.05f, 0.05f), MathUtil.random(-0.05f, 0.05f));

        rotationPoint = rotationPoint.add(rotationMotion);

        // Сталкиваемся с хитбоксом по X
        if (rotationPoint.x >= (lenghtX - 0.05) / 2f)
            rotationMotion = new Vec3d(-MathUtil.random(minMotionXZ, maxMotionXZ), rotationMotion.getY(), rotationMotion.getZ());

        // Сталкиваемся с хитбоксом по Y
        if (rotationPoint.y >= lenghtY)
            rotationMotion = new Vec3d(rotationMotion.getX(), -MathUtil.random(minMotionY, maxMotionY), rotationMotion.getZ());

        // Сталкиваемся с хитбоксом по Z
        if (rotationPoint.z >= (lenghtZ - 0.05) / 2f)
            rotationMotion = new Vec3d(rotationMotion.getX(), rotationMotion.getY(), -MathUtil.random(minMotionXZ, maxMotionXZ));

        // Сталкиваемся с хитбоксом по -X
        if (rotationPoint.x <= -(lenghtX - 0.05) / 2f)
            rotationMotion = new Vec3d(MathUtil.random(minMotionXZ, 0.03f), rotationMotion.getY(), rotationMotion.getZ());

        // Сталкиваемся с хитбоксом по -Y
        if (rotationPoint.y <= 0.05)
            rotationMotion = new Vec3d(rotationMotion.getX(), MathUtil.random(minMotionY, maxMotionY), rotationMotion.getZ());

        // Сталкиваемся с хитбоксом по -Z
        if (rotationPoint.z <= -(lenghtZ - 0.05) / 2f)
            rotationMotion = new Vec3d(rotationMotion.getX(), rotationMotion.getY(), MathUtil.random(minMotionXZ, maxMotionXZ));

        // Добавляем джиттер
        rotationPoint.add(MathUtil.random(-0.03f, 0.03f), 0f, MathUtil.random(-0.03f, 0.03f));

        float[] rotation;

        // Если мы перестали смотреть на цель
        if (!PlayerHandler.checkRtx(rotationYaw, rotationPitch, getAttackRange(), false, true)) {
            float[] rotation1 = PlayerHandler.calcAngle(target.getPos().add(0, target.getEyeHeight(target.getPose()) / 2f, 0));

            // Проверяем видимость центра игрока
            if (PlayerHandler.squaredDistanceFromEyes(target.getPos().add(0, target.getEyeHeight(target.getPose()) / 2f, 0)) <= getAttackRange() * getAttackRange()
                    && PlayerHandler.checkRtx(rotation1[0], rotation1[1], getAttackRange(), false, true)) {
                // наводим на центр
                rotationPoint = new Vec3d(MathUtil.random(-0.1f, 0.1f), target.getEyeHeight(target.getPose()) / (MathUtil.random(1.8f, 2.5f)), MathUtil.random(-0.1f, 0.1f));
            } else {
                // Сканим хитбокс на видимую точку
                float halfBox = (float) (lenghtX / 2f);

                for (float x1 = -halfBox; x1 <= halfBox; x1 += 0.05f) {
                    for (float z1 = -halfBox; z1 <= halfBox; z1 += 0.05f) {
                        for (float y1 = 0.05f; y1 <= target.getBoundingBox().getLengthY(); y1 += 0.15f) {

                            Vec3d v1 = new Vec3d(target.getX() + x1, target.getY() + y1, target.getZ() + z1);

                            // Скипаем, если вне досягаемости
                            if (PlayerHandler.squaredDistanceFromEyes(v1) > getAttackRange() * getAttackRange()) continue;

                            rotation = PlayerHandler.calcAngle(v1);
                            if (PlayerHandler.checkRtx(rotation[0], rotation[1],getAttackRange(), false, true)) {
                                // Наводимся, если видим эту точку
                                rotationPoint = new Vec3d(x1, y1, z1);
                                break;
                            }
                        }
                    }
                }
            }
        }
        return target.getPos().add(rotationPoint);
    }

    private void updateRotations() {
        Vec3d targetVec;

        targetVec = getLegitLook(target);

        pitchAcceleration = mc.player.isFallFlying() ? 90.0F : 8.0F;

        float delta_yaw = net.minecraft.util.math.MathHelper.wrapDegrees((float) net.minecraft.util.math.MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(targetVec.z - mc.player.getZ(), (targetVec.x - mc.player.getX()))) - 90) - rotationYaw);
        float delta_pitch = ((float) (-Math.toDegrees(Math.atan2(targetVec.y - (mc.player.getPos().y + mc.player.getEyeHeight(mc.player.getPose())), Math.sqrt(Math.pow((targetVec.x - mc.player.getX()), 2) + Math.pow(targetVec.z - mc.player.getZ(), 2))))) - rotationPitch);

        float yawStep = MathUtil.random(15, 25);
        float pitchStep = pitchAcceleration + MathUtil.random(-1F, 1F);

        if (delta_yaw > 180)
            delta_yaw = delta_yaw - 180;

        float deltaYaw = net.minecraft.util.math.MathHelper.clamp(net.minecraft.util.math.MathHelper.abs(delta_yaw), -yawStep, yawStep);
        float deltaPitch = net.minecraft.util.math.MathHelper.clamp(delta_pitch, -pitchStep, pitchStep);

        float newYaw = rotationYaw + (delta_yaw > 0 ? deltaYaw : -deltaYaw);
        float newPitch = net.minecraft.util.math.MathHelper.clamp(rotationPitch + deltaPitch, -90.0F, 90.0F);

        double gcdFix = (Math.pow(mc.options.getMouseSensitivity().getValue() * 0.8 + 0.2, 3.0)) * 1.2;

        rotationYaw = (float) (newYaw - (newYaw - rotationYaw) % gcdFix);
        rotationPitch = (float) (newPitch - (newPitch - rotationPitch) % gcdFix);

        MovementFix.rotationYaw = rotationYaw;
        MovementFix.rotationPitch = rotationPitch;
    }


    private void ftRotation() {
        Vec3d targetPos = target.getPos().add(0, target.getHeight() / 2.0, 0);
        Vec3d playerEyePos = mc.player.getEyePos();

        Vec3d difference = targetPos.subtract(playerEyePos);
        double distance = Math.sqrt(difference.x * difference.x + difference.z * difference.z);

        float yaw = (float) (Math.toDegrees(Math.atan2(difference.z, difference.x)) - 90.0);
        float pitch = (float) (-Math.toDegrees(Math.atan2(difference.y, distance)));

        rotationYaw = yaw;
        rotationPitch = pitch;

        MovementFix.rotationYaw = yaw;
        MovementFix.rotationPitch = pitch;
    }

    private Entity findTarget() {
        return (LivingEntity) StreamSupport.stream(mc.world.getEntities().spliterator(), false)
                .filter(entity -> entity instanceof LivingEntity && entity != mc.player && isValid((LivingEntity) entity))
                .min(Comparator.comparing(entity -> entity.squaredDistanceTo(mc.player))).orElse(null);
    }

    private boolean isValid(LivingEntity targetEntity) {
        if (targetEntity == null
                || targetEntity instanceof ArmorStandEntity
                || !targetEntity.isAlive()
                || mc.player.distanceTo(targetEntity) >= getAttackRange()) {
            return false;
        }

        if (RemoveBots.isBot(targetEntity)) {
            return false;
        }

        if (targetEntity instanceof PlayerEntity) {
            PlayerEntity player = (PlayerEntity) targetEntity;
            if (!FriendManager.checkFriend(player.getName().getString()) && !RemoveBots.isBot(targetEntity)) {
                return true;
            }
        }

        if (FriendManager.checkFriend(targetEntity.getName().getString()) && !RemoveBots.isBot(targetEntity)) {
            return false;
        }

        return false;
    }


    private boolean shouldCancelCrit() {
        return !onlyCrits.get()
                || mc.player.getAbilities().flying
                || mc.player.hasStatusEffect(StatusEffects.LEVITATION)
                || mc.player.hasStatusEffect(StatusEffects.BLINDNESS)
                || PlayerHandler.isPlayerInWeb()
                || mc.world.getBlockState(mc.player.getBlockPos()).getBlock() == Blocks.LADDER;
    }
    private boolean canCrit() {
        if (mc.player.getAttackCooldownProgress(0.5f) < 0.9F) return false;

        if (mc.player.isInLava()) return true;

        if (!mc.options.jumpKey.isPressed() && PlayerHandler.isAboveWater()) return true;

        if (!shouldCancelCrit()) return !mc.player.isOnGround() && mc.player.fallDistance > 0.0f;

        return true;
    }


    private void attackTarget() {
        if (mc.player.distanceTo(target) >= getAttackRange()) return;

        if (!canCrit()) return;

        if (mc.player.isUsingItem() && noAttackWenUsingItem.get()) {
            return;
        }

        if (!canSeeTarget() && !attackWals.get()) {
            return;
        }

        mc.interactionManager.attackEntity(mc.player, target);
        mc.player.swingHand(Hand.MAIN_HAND);
    }

    private boolean canSeeTarget() {
        Vec3d playerPos = mc.player.getPos();
        Vec3d targetPos = target.getPos();

        RaycastContext context = new RaycastContext(
                playerPos,
                targetPos,
                RaycastContext.ShapeType.OUTLINE,
                RaycastContext.FluidHandling.NONE,
                mc.player
        );

        HitResult result = mc.world.raycast(context);

        if (result.getType() == HitResult.Type.MISS) {
            return true;
        }
        if (result.getType() == HitResult.Type.BLOCK) {
            return false;
        }
        if (result instanceof EntityHitResult entityHitResult) {
            return entityHitResult.getEntity() == target;
        }

        return false;
    }

    public float getAttackRange() {
        return range.get();
    }
}
как блюмаус еще не спастил это? или же блейдселл
 
Назад
Сверху Снизу