Исходник Nevernight FTaura | Expensive 3.1

Начинающий
Статус
Оффлайн
Регистрация
5 Июн 2024
Сообщения
8
Реакции[?]
0
Поинты[?]
0

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

Знаю что опенсурс
Но кому лень доставать держите
-
Code
KillAura:
//
// Source code recreated from a By Furious Client
//

package ua.nevernight.functions.impl.combat;

import com.google.common.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.item.ArmorStandEntity;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import ua.nevernight.nevernight;
import ua.nevernight.command.friends.FriendStorage;
import ua.nevernight.events.EventInput;
import ua.nevernight.events.EventMotion;
import ua.nevernight.events.EventUpdate;
import ua.nevernight.functions.api.Category;
import ua.nevernight.functions.api.Function;
import ua.nevernight.functions.api.FunctionRegister;
import ua.nevernight.functions.settings.Setting;
import ua.nevernight.functions.settings.impl.BooleanSetting;
import ua.nevernight.functions.settings.impl.ModeListSetting;
import ua.nevernight.functions.settings.impl.ModeSetting;
import ua.nevernight.functions.settings.impl.SliderSetting;
import ua.nevernight.utils.math.SensUtils;
import ua.nevernight.utils.math.StopWatch;
import ua.nevernight.utils.player.InventoryUtil;
import ua.nevernight.utils.player.MouseUtil;
import ua.nevernight.utils.player.MoveUtils;

@FunctionRegister(
    name = "KillAura",
    type = Category.Combat
)
public class FTaura extends Function {
    private final ModeSetting type = new ModeSetting("Тип", "Плавная", new String[]{"Плавная", "Резкая", "Незаметная", "FunTIme"});
    private final SliderSetting attackRange = new SliderSetting("Дистанция аттаки", 3.0F, 3.0F, 6.0F, 0.1F);
    private final SliderSetting rotateDistance = new SliderSetting("Дистанция ротации", 1.0F, 0.0F, 3.0F, 0.1F);
    private final BooleanSetting criticalHits = new BooleanSetting("Криты с места", false);
    final ModeListSetting targets = new ModeListSetting("Таргеты", new BooleanSetting[]{new BooleanSetting("Игроки", true), new BooleanSetting("Голые", true), new BooleanSetting("Мобы", false), new BooleanSetting("Животные", false), new BooleanSetting("Друзья", false), new BooleanSetting("Голые невидимки", true), new BooleanSetting("Невидимки", true)});
    final ModeListSetting options = new ModeListSetting("Опции", new BooleanSetting[]{new BooleanSetting("Только Криты", true), new BooleanSetting("Криты с пробелом", true), new BooleanSetting("Ломать щит", true), new BooleanSetting("Отжимать щит", true), new BooleanSetting("Синхронизировать атаку с ТПС", false), new BooleanSetting("Фокусировать одну цель", true), new BooleanSetting("Коррекция движения", true)});
    final ModeSetting correctionType = new ModeSetting("Тип коррекции", "Незаметный", new String[]{"Незаметный", "Сфокусированный"});
    private final StopWatch stopWatch = new StopWatch();
    private Vector2f rotateVector = new Vector2f(0.0F, 0.0F);
    private LivingEntity target;
    private Entity selected;
    int ticks = 0;
    boolean isRotated;
    final AutoPotion autoPotion;
    float lastYaw;
    float lastPitch;

    public FTaura(AutoPotion autoPotion) {
        this.autoPotion = autoPotion;
        this.addSettings(new Setting[]{this.type, this.attackRange, this.rotateDistance, this.targets, this.options, this.correctionType, this.criticalHits});
    }

    @Subscribe
    public void onInput(EventInput eventInput) {
        if (eventInput != null && (Boolean)this.options.getValueByName("Коррекция движения").get() && this.correctionType.is("Незаметный")) {
            MoveUtils.fixMovement(eventInput, this.rotateVector.x);
        }

    }

    @Subscribe
    public void onUpdate(EventUpdate e) {
        if ((Boolean)this.options.getValueByName("Фокусировать одну цель").get() && (this.target == null || !this.isValid(this.target)) || !(Boolean)this.options.getValueByName("Фокусировать одну цель").get()) {
            this.updateTarget();
        }

        if (this.target != null && (!this.autoPotion.isState() || !this.autoPotion.isActive())) {
            this.isRotated = false;
            if (this.shouldPlayerFalling() && this.stopWatch.hasTimeElapsed()) {
                this.updateAttack();
                this.ticks = 2;
            }

            if (this.type.is("Резкая")) {
                if (this.ticks > 0) {
                    this.updateRotation(true, 180.0F, 90.0F);
                    --this.ticks;
                } else {
                    this.reset();
                    --this.ticks;
                }
            } else if (!this.isRotated) {
                this.updateRotation(false, 80.0F, 35.0F);
            }

            if (this.shouldPlayerFalling() && this.stopWatch.hasTimeElapsed()) {
                this.updateAttack();
                this.ticks = 1;
            }

            if (this.type.is("Резкая")) {
                if (this.ticks > 0) {
                    this.updateRotation(true, 180.0F, 90.0F);
                } else {
                    this.reset();
                }
            }

            if (this.type.is("Незаметная") && this.ticks > 0) {
                this.updateRotation(true, 70.0F, 50.0F);
            }
        } else {
            this.stopWatch.setLastMS(0L);
            this.reset();
        }

    }

    public LivingEntity getTarget() {
        return this.target;
    }

    @Subscribe
    private void onWalking(EventMotion e) {
        if (this.target != null && (!this.autoPotion.isState() || !this.autoPotion.isActive())) {
            float yaw = this.rotateVector.x;
            float pitch = this.rotateVector.y;
            float headRot = mc.player.prevRotationYawHead;
            float maxHeadRot = 40.0F;
            float bodRot = mc.player.prevRotationYaw;
            float bodYaw;
            if (Math.abs(headRot - bodRot) > maxHeadRot) {
                if (headRot > bodRot) {
                    bodYaw = headRot + ThreadLocalRandom.current().nextFloat(1.0F, 15.0F);
                } else {
                    bodYaw = headRot - ThreadLocalRandom.current().nextFloat(1.0F, 15.0F);
                }
            } else {
                bodYaw = bodRot;
            }

            float newBodYaw = Math.min(Math.max(bodYaw, 0.0F), 10.0F);
            mc.player.renderYawOffset = bodYaw;
            mc.player.rotationYawHead = yaw;
            mc.player.rotationPitchHead = pitch;
            e.setYaw(yaw);
            e.setPitch(pitch);
        }

    }

    private void updateTarget() {
        List<LivingEntity> targets = new ArrayList();
        Iterator var2 = mc.world.getAllEntities().iterator();

        while(var2.hasNext()) {
            Entity entity = (Entity)var2.next();
            if (entity instanceof LivingEntity living) {
                if (this.isValid(living)) {
                    targets.add(living);
                }
            }
        }

        if (targets.isEmpty()) {
            this.target = null;
        } else if (targets.size() == 1) {
            this.target = (LivingEntity)targets.get(0);
        } else {
            targets.sort(Comparator.comparingDouble((object) -> {
                if (object instanceof PlayerEntity player) {
                    return -this.getEntityArmor(player);
                } else if (object instanceof LivingEntity base) {
                    return (double)(-base.getTotalArmorValue());
                } else {
                    return 0.0;
                }
            }).thenComparing((object, object2) -> {
                double d2 = this.getEntityHealth((LivingEntity)object);
                double d3 = this.getEntityHealth((LivingEntity)object2);
                return Double.compare(d2, d3);
            }).thenComparing((object, object2) -> {
                double d2 = (double)mc.player.getDistance((LivingEntity)object);
                double d3 = (double)mc.player.getDistance((LivingEntity)object2);
                return Double.compare(d2, d3);
            }));
            this.target = (LivingEntity)targets.get(0);
        }
    }

    private void updateRotation(boolean attack, float rotationYawSpeed, float rotationPitchSpeed) {
        Vector3d vec = this.target.getPositionVec().add(0.0, MathHelper.clamp(mc.player.getPosYEye() - this.target.getPosY(), 0.0, (double)this.target.getHeight() * (mc.player.getDistanceEyePos(this.target) / (double)(Float)this.attackRange.get())), 0.0).subtract(mc.player.getEyePosition(1.0F));
        this.isRotated = true;
        float yawToTarget = (float)MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(vec.z, vec.x)) - 90.0);
        float pitchToTarget = (float)(-Math.toDegrees(Math.atan2(vec.y, Math.hypot(vec.x, vec.z))));
        float yawDelta = MathHelper.wrapDegrees(yawToTarget - this.rotateVector.x);
        float pitchDelta = MathHelper.wrapDegrees(pitchToTarget - this.rotateVector.y);
        int roundedYaw = (int)yawDelta;
        float gcd;
        float clampedPitch;
        float yaw;
        float yawRandomness;
        float yaw;
        switch ((String)this.type.get()) {
            case "Плавная":
                gcd = Math.min(Math.max(Math.abs(yawDelta), 1.0F), rotationYawSpeed);
                clampedPitch = Math.min(Math.max(Math.abs(pitchDelta), 1.0F), rotationPitchSpeed);
                if (Math.abs(gcd - this.lastYaw) <= 2.0F) {
                    gcd = this.lastYaw + 2.1F;
                }

                yaw = this.rotateVector.x + (yawDelta > 0.0F ? gcd : -gcd);
                yawRandomness = MathHelper.clamp(this.rotateVector.y + (pitchDelta > 0.0F ? clampedPitch : -clampedPitch), -89.0F, 89.0F);
                yaw = SensUtils.getGCDValue();
                yaw -= (yaw - this.rotateVector.x) % yaw;
                yawRandomness -= (yawRandomness - this.rotateVector.y) % yaw;
                this.rotateVector = new Vector2f(yaw, yawRandomness);
                this.lastYaw = gcd;
                this.lastPitch = clampedPitch;
                if ((Boolean)this.options.getValueByName("Коррекция движения").get()) {
                    mc.player.rotationYawOffset = yaw;
                }
                break;
            case "Резкая":
                gcd = this.rotateVector.x + (float)roundedYaw;
                clampedPitch = MathHelper.clamp(this.rotateVector.y + pitchDelta, -90.0F, 90.0F);
                yaw = SensUtils.getGCDValue();
                gcd -= (gcd - this.rotateVector.x) % yaw;
                clampedPitch -= (clampedPitch - this.rotateVector.y) % yaw;
                this.rotateVector = new Vector2f(gcd, clampedPitch);
                if ((Boolean)this.options.getValueByName("Коррекция движения").get()) {
                    mc.player.rotationYawOffset = gcd;
                }
                break;
            case "Незаметная":
                gcd = SensUtils.getGCDValue();
                clampedPitch = 0.0F;
                yaw = 0.0F;
                if (!((double)mc.player.fallDistance <= 0.6)) {
                    return;
                }

                yawRandomness = (float)(Math.random() * 14.0 - 7.0);
                yaw = this.rotateVector.x + (float)roundedYaw + yawRandomness;
                float pitchRandomness = (float)(Math.random() * 2.0 - 5.0);
                float pitch = MathHelper.clamp(this.rotateVector.y + pitchDelta + pitchRandomness, -90.0F, 90.0F);
                yaw -= (yaw - this.rotateVector.x) % gcd;
                pitch -= (pitch - this.rotateVector.y) % gcd;
                this.rotateVector = new Vector2f(yaw, pitch);
                mc.player.rotationYaw = this.rotateVector.x;
                mc.player.rotationPitch = this.rotateVector.y;
        }

    }

    private void updateAttack() {
        this.selected = MouseUtil.getMouseOver(this.target, this.rotateVector.x, this.rotateVector.y, (double)(Float)this.attackRange.get());
        if (!(mc.player.getHealth() < 12.0F) || !this.autoPotion.isActive()) {
            if (this.selected != null && this.selected == this.target || mc.player.isElytraFlying()) {
                if (mc.player.isBlocking() && (Boolean)this.options.getValueByName("Отжимать щит").get()) {
                    mc.playerController.onStoppedUsingItem(mc.player);
                }

                this.stopWatch.setLastMS(50L);
                mc.playerController.attackEntity(mc.player, this.target);
                mc.player.swingArm(Hand.MAIN_HAND);
                LivingEntity var2 = this.target;
                if (var2 instanceof PlayerEntity) {
                    PlayerEntity player = (PlayerEntity)var2;
                    if ((Boolean)this.options.getValueByName("Ломать щит").get()) {
                        this.breakShieldPlayer(player);
                    }
                }

            }
        }
    }

    private boolean shouldPerformCriticalHit() {
        return !mc.player.isOnGround() && !mc.player.isInWater() && !mc.player.isInLava() && !mc.player.isElytraFlying() && !mc.player.isOnLadder() && !mc.player.isPassenger() && !mc.player.abilities.isFlying;
    }

    private boolean shouldPlayerFalling() {
        boolean cancelReason = mc.player.isInWater() && mc.player.areEyesInFluid(FluidTags.WATER) || mc.player.isInLava() || mc.player.isOnLadder() || mc.player.isPassenger() || mc.player.abilities.isFlying;
        boolean onSpace = mc.player.isOnGround() && !mc.gameSettings.keyBindJump.isKeyDown();
        float attackStrength = mc.player.getCooledAttackStrength((Boolean)this.options.getValueByName("Синхронизировать атаку с ТПС").get() ? nevernight.getInstance().getTpsCalc().getAdjustTicks() : 1.5F);
        if (attackStrength < 0.92F) {
            return false;
        } else if (!cancelReason && (Boolean)this.options.getValueByName("Криты с пробелом").get()) {
            return onSpace || !mc.player.isOnGround() && mc.player.fallDistance > 0.0F;
        } else if (!cancelReason && (Boolean)this.options.getValueByName("Только Криты").get()) {
            return !mc.player.isOnGround() && mc.player.fallDistance > 0.0F;
        } else {
            return true;
        }
    }

    private boolean isValid(LivingEntity entity) {
        if (entity instanceof ClientPlayerEntity) {
            return false;
        } else if (entity.ticksExisted < 3) {
            return false;
        } else if (mc.player.getDistanceEyePos(entity) > (double)(Float)this.attackRange.get() + (double)(Float)this.rotateDistance.get()) {
            return false;
        } else {
            if (entity instanceof PlayerEntity) {
                PlayerEntity p = (PlayerEntity)entity;
                if (AntiBot.isBot(entity)) {
                    return false;
                }

                if (!(Boolean)this.targets.getValueByName("Друзья").get() && FriendStorage.isFriend(p.getName().getString())) {
                    return false;
                }

                if (p.getName().getString().equalsIgnoreCase(mc.player.getName().getString())) {
                    return false;
                }
            }

            if (entity instanceof PlayerEntity && !(Boolean)this.targets.getValueByName("Игроки").get()) {
                return false;
            } else if (entity instanceof PlayerEntity && entity.getTotalArmorValue() == 0 && !(Boolean)this.targets.getValueByName("Голые").get()) {
                return false;
            } else if (entity instanceof PlayerEntity && entity.isInvisible() && entity.getTotalArmorValue() == 0 && !(Boolean)this.targets.getValueByName("Голые невидимки").get()) {
                return false;
            } else if (entity instanceof PlayerEntity && entity.isInvisible() && !(Boolean)this.targets.getValueByName("Невидимки").get()) {
                return false;
            } else if (entity instanceof MonsterEntity && !(Boolean)this.targets.getValueByName("Мобы").get()) {
                return false;
            } else if (entity instanceof AnimalEntity && !(Boolean)this.targets.getValueByName("Животные").get()) {
                return false;
            } else {
                return !entity.isInvulnerable() && entity.isAlive() && !(entity instanceof ArmorStandEntity);
            }
        }
    }

    private void breakShieldPlayer(PlayerEntity entity) {
        if (entity.isBlocking()) {
            int invSlot = InventoryUtil.getInstance().getAxeInInventory(false);
            int hotBarSlot = InventoryUtil.getInstance().getAxeInInventory(true);
            if (hotBarSlot == -1 && invSlot != -1) {
                int bestSlot = InventoryUtil.getInstance().findBestSlotInHotBar();
                mc.playerController.windowClick(0, invSlot, 0, ClickType.PICKUP, mc.player);
                mc.playerController.windowClick(0, bestSlot + 36, 0, ClickType.PICKUP, mc.player);
                mc.player.connection.sendPacket(new CHeldItemChangePacket(bestSlot));
                mc.playerController.attackEntity(mc.player, entity);
                mc.player.swingArm(Hand.MAIN_HAND);
                mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
                mc.playerController.windowClick(0, bestSlot + 36, 0, ClickType.PICKUP, mc.player);
                mc.playerController.windowClick(0, invSlot, 0, ClickType.PICKUP, mc.player);
            }

            if (hotBarSlot != -1) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(hotBarSlot));
                mc.playerController.attackEntity(mc.player, entity);
                mc.player.swingArm(Hand.MAIN_HAND);
                mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
            }
        }

    }

    private void reset() {
        if ((Boolean)this.options.getValueByName("Коррекция движения").get()) {
            mc.player.rotationYawOffset = -2.14748365E9F;
        }

        this.rotateVector = new Vector2f(mc.player.rotationYaw, mc.player.rotationPitch);
    }

    public void onEnable() {
        super.onEnable();
        this.reset();
        this.target = null;
    }

    public void onDisable() {
        super.onDisable();
        this.reset();
        this.stopWatch.setLastMS(0L);
        this.target = null;
    }

    private double getEntityArmor(PlayerEntity entityPlayer2) {
        double d2 = 0.0;

        for(int i2 = 0; i2 < 4; ++i2) {
            ItemStack is = (ItemStack)entityPlayer2.inventory.armorInventory.get(i2);
            if (is.getItem() instanceof ArmorItem) {
                d2 += this.getProtectionLvl(is);
            }
        }

        return d2;
    }

    private double getProtectionLvl(ItemStack stack) {
        Item var3 = stack.getItem();
        if (var3 instanceof ArmorItem i) {
            double damageReduceAmount = (double)i.getDamageReduceAmount();
            if (stack.isEnchanted()) {
                damageReduceAmount += (double)EnchantmentHelper.getEnchantmentLevel(Enchantments.PROTECTION, stack) * 0.25;
            }

            return damageReduceAmount;
        } else {
            return 0.0;
        }
    }

    private double getEntityHealth(LivingEntity ent) {
        if (ent instanceof PlayerEntity player) {
            return (double)(player.getHealth() + player.getAbsorptionAmount()) * (this.getEntityArmor(player) / 20.0);
        } else {
            return (double)(ent.getHealth() + ent.getAbsorptionAmount());
        }
    }

    public ModeSetting getType() {
        return this.type;
    }

    public ModeListSetting getOptions() {
        return this.options;
    }

    public StopWatch getStopWatch() {
        return this.stopWatch;
    }
}
 
Начинающий
Статус
Оффлайн
Регистрация
20 Фев 2024
Сообщения
100
Реакции[?]
0
Поинты[?]
0
Знаю что опенсурс
Но кому лень доставать держите
-
Code
KillAura:
//
// Source code recreated from a By Furious Client
//

package ua.nevernight.functions.impl.combat;

import com.google.common.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.item.ArmorStandEntity;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import ua.nevernight.nevernight;
import ua.nevernight.command.friends.FriendStorage;
import ua.nevernight.events.EventInput;
import ua.nevernight.events.EventMotion;
import ua.nevernight.events.EventUpdate;
import ua.nevernight.functions.api.Category;
import ua.nevernight.functions.api.Function;
import ua.nevernight.functions.api.FunctionRegister;
import ua.nevernight.functions.settings.Setting;
import ua.nevernight.functions.settings.impl.BooleanSetting;
import ua.nevernight.functions.settings.impl.ModeListSetting;
import ua.nevernight.functions.settings.impl.ModeSetting;
import ua.nevernight.functions.settings.impl.SliderSetting;
import ua.nevernight.utils.math.SensUtils;
import ua.nevernight.utils.math.StopWatch;
import ua.nevernight.utils.player.InventoryUtil;
import ua.nevernight.utils.player.MouseUtil;
import ua.nevernight.utils.player.MoveUtils;

@FunctionRegister(
    name = "KillAura",
    type = Category.Combat
)
public class FTaura extends Function {
    private final ModeSetting type = new ModeSetting("Тип", "Плавная", new String[]{"Плавная", "Резкая", "Незаметная", "FunTIme"});
    private final SliderSetting attackRange = new SliderSetting("Дистанция аттаки", 3.0F, 3.0F, 6.0F, 0.1F);
    private final SliderSetting rotateDistance = new SliderSetting("Дистанция ротации", 1.0F, 0.0F, 3.0F, 0.1F);
    private final BooleanSetting criticalHits = new BooleanSetting("Криты с места", false);
    final ModeListSetting targets = new ModeListSetting("Таргеты", new BooleanSetting[]{new BooleanSetting("Игроки", true), new BooleanSetting("Голые", true), new BooleanSetting("Мобы", false), new BooleanSetting("Животные", false), new BooleanSetting("Друзья", false), new BooleanSetting("Голые невидимки", true), new BooleanSetting("Невидимки", true)});
    final ModeListSetting options = new ModeListSetting("Опции", new BooleanSetting[]{new BooleanSetting("Только Криты", true), new BooleanSetting("Криты с пробелом", true), new BooleanSetting("Ломать щит", true), new BooleanSetting("Отжимать щит", true), new BooleanSetting("Синхронизировать атаку с ТПС", false), new BooleanSetting("Фокусировать одну цель", true), new BooleanSetting("Коррекция движения", true)});
    final ModeSetting correctionType = new ModeSetting("Тип коррекции", "Незаметный", new String[]{"Незаметный", "Сфокусированный"});
    private final StopWatch stopWatch = new StopWatch();
    private Vector2f rotateVector = new Vector2f(0.0F, 0.0F);
    private LivingEntity target;
    private Entity selected;
    int ticks = 0;
    boolean isRotated;
    final AutoPotion autoPotion;
    float lastYaw;
    float lastPitch;

    public FTaura(AutoPotion autoPotion) {
        this.autoPotion = autoPotion;
        this.addSettings(new Setting[]{this.type, this.attackRange, this.rotateDistance, this.targets, this.options, this.correctionType, this.criticalHits});
    }

    @Subscribe
    public void onInput(EventInput eventInput) {
        if (eventInput != null && (Boolean)this.options.getValueByName("Коррекция движения").get() && this.correctionType.is("Незаметный")) {
            MoveUtils.fixMovement(eventInput, this.rotateVector.x);
        }

    }

    @Subscribe
    public void onUpdate(EventUpdate e) {
        if ((Boolean)this.options.getValueByName("Фокусировать одну цель").get() && (this.target == null || !this.isValid(this.target)) || !(Boolean)this.options.getValueByName("Фокусировать одну цель").get()) {
            this.updateTarget();
        }

        if (this.target != null && (!this.autoPotion.isState() || !this.autoPotion.isActive())) {
            this.isRotated = false;
            if (this.shouldPlayerFalling() && this.stopWatch.hasTimeElapsed()) {
                this.updateAttack();
                this.ticks = 2;
            }

            if (this.type.is("Резкая")) {
                if (this.ticks > 0) {
                    this.updateRotation(true, 180.0F, 90.0F);
                    --this.ticks;
                } else {
                    this.reset();
                    --this.ticks;
                }
            } else if (!this.isRotated) {
                this.updateRotation(false, 80.0F, 35.0F);
            }

            if (this.shouldPlayerFalling() && this.stopWatch.hasTimeElapsed()) {
                this.updateAttack();
                this.ticks = 1;
            }

            if (this.type.is("Резкая")) {
                if (this.ticks > 0) {
                    this.updateRotation(true, 180.0F, 90.0F);
                } else {
                    this.reset();
                }
            }

            if (this.type.is("Незаметная") && this.ticks > 0) {
                this.updateRotation(true, 70.0F, 50.0F);
            }
        } else {
            this.stopWatch.setLastMS(0L);
            this.reset();
        }

    }

    public LivingEntity getTarget() {
        return this.target;
    }

    @Subscribe
    private void onWalking(EventMotion e) {
        if (this.target != null && (!this.autoPotion.isState() || !this.autoPotion.isActive())) {
            float yaw = this.rotateVector.x;
            float pitch = this.rotateVector.y;
            float headRot = mc.player.prevRotationYawHead;
            float maxHeadRot = 40.0F;
            float bodRot = mc.player.prevRotationYaw;
            float bodYaw;
            if (Math.abs(headRot - bodRot) > maxHeadRot) {
                if (headRot > bodRot) {
                    bodYaw = headRot + ThreadLocalRandom.current().nextFloat(1.0F, 15.0F);
                } else {
                    bodYaw = headRot - ThreadLocalRandom.current().nextFloat(1.0F, 15.0F);
                }
            } else {
                bodYaw = bodRot;
            }

            float newBodYaw = Math.min(Math.max(bodYaw, 0.0F), 10.0F);
            mc.player.renderYawOffset = bodYaw;
            mc.player.rotationYawHead = yaw;
            mc.player.rotationPitchHead = pitch;
            e.setYaw(yaw);
            e.setPitch(pitch);
        }

    }

    private void updateTarget() {
        List<LivingEntity> targets = new ArrayList();
        Iterator var2 = mc.world.getAllEntities().iterator();

        while(var2.hasNext()) {
            Entity entity = (Entity)var2.next();
            if (entity instanceof LivingEntity living) {
                if (this.isValid(living)) {
                    targets.add(living);
                }
            }
        }

        if (targets.isEmpty()) {
            this.target = null;
        } else if (targets.size() == 1) {
            this.target = (LivingEntity)targets.get(0);
        } else {
            targets.sort(Comparator.comparingDouble((object) -> {
                if (object instanceof PlayerEntity player) {
                    return -this.getEntityArmor(player);
                } else if (object instanceof LivingEntity base) {
                    return (double)(-base.getTotalArmorValue());
                } else {
                    return 0.0;
                }
            }).thenComparing((object, object2) -> {
                double d2 = this.getEntityHealth((LivingEntity)object);
                double d3 = this.getEntityHealth((LivingEntity)object2);
                return Double.compare(d2, d3);
            }).thenComparing((object, object2) -> {
                double d2 = (double)mc.player.getDistance((LivingEntity)object);
                double d3 = (double)mc.player.getDistance((LivingEntity)object2);
                return Double.compare(d2, d3);
            }));
            this.target = (LivingEntity)targets.get(0);
        }
    }

    private void updateRotation(boolean attack, float rotationYawSpeed, float rotationPitchSpeed) {
        Vector3d vec = this.target.getPositionVec().add(0.0, MathHelper.clamp(mc.player.getPosYEye() - this.target.getPosY(), 0.0, (double)this.target.getHeight() * (mc.player.getDistanceEyePos(this.target) / (double)(Float)this.attackRange.get())), 0.0).subtract(mc.player.getEyePosition(1.0F));
        this.isRotated = true;
        float yawToTarget = (float)MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(vec.z, vec.x)) - 90.0);
        float pitchToTarget = (float)(-Math.toDegrees(Math.atan2(vec.y, Math.hypot(vec.x, vec.z))));
        float yawDelta = MathHelper.wrapDegrees(yawToTarget - this.rotateVector.x);
        float pitchDelta = MathHelper.wrapDegrees(pitchToTarget - this.rotateVector.y);
        int roundedYaw = (int)yawDelta;
        float gcd;
        float clampedPitch;
        float yaw;
        float yawRandomness;
        float yaw;
        switch ((String)this.type.get()) {
            case "Плавная":
                gcd = Math.min(Math.max(Math.abs(yawDelta), 1.0F), rotationYawSpeed);
                clampedPitch = Math.min(Math.max(Math.abs(pitchDelta), 1.0F), rotationPitchSpeed);
                if (Math.abs(gcd - this.lastYaw) <= 2.0F) {
                    gcd = this.lastYaw + 2.1F;
                }

                yaw = this.rotateVector.x + (yawDelta > 0.0F ? gcd : -gcd);
                yawRandomness = MathHelper.clamp(this.rotateVector.y + (pitchDelta > 0.0F ? clampedPitch : -clampedPitch), -89.0F, 89.0F);
                yaw = SensUtils.getGCDValue();
                yaw -= (yaw - this.rotateVector.x) % yaw;
                yawRandomness -= (yawRandomness - this.rotateVector.y) % yaw;
                this.rotateVector = new Vector2f(yaw, yawRandomness);
                this.lastYaw = gcd;
                this.lastPitch = clampedPitch;
                if ((Boolean)this.options.getValueByName("Коррекция движения").get()) {
                    mc.player.rotationYawOffset = yaw;
                }
                break;
            case "Резкая":
                gcd = this.rotateVector.x + (float)roundedYaw;
                clampedPitch = MathHelper.clamp(this.rotateVector.y + pitchDelta, -90.0F, 90.0F);
                yaw = SensUtils.getGCDValue();
                gcd -= (gcd - this.rotateVector.x) % yaw;
                clampedPitch -= (clampedPitch - this.rotateVector.y) % yaw;
                this.rotateVector = new Vector2f(gcd, clampedPitch);
                if ((Boolean)this.options.getValueByName("Коррекция движения").get()) {
                    mc.player.rotationYawOffset = gcd;
                }
                break;
            case "Незаметная":
                gcd = SensUtils.getGCDValue();
                clampedPitch = 0.0F;
                yaw = 0.0F;
                if (!((double)mc.player.fallDistance <= 0.6)) {
                    return;
                }

                yawRandomness = (float)(Math.random() * 14.0 - 7.0);
                yaw = this.rotateVector.x + (float)roundedYaw + yawRandomness;
                float pitchRandomness = (float)(Math.random() * 2.0 - 5.0);
                float pitch = MathHelper.clamp(this.rotateVector.y + pitchDelta + pitchRandomness, -90.0F, 90.0F);
                yaw -= (yaw - this.rotateVector.x) % gcd;
                pitch -= (pitch - this.rotateVector.y) % gcd;
                this.rotateVector = new Vector2f(yaw, pitch);
                mc.player.rotationYaw = this.rotateVector.x;
                mc.player.rotationPitch = this.rotateVector.y;
        }

    }

    private void updateAttack() {
        this.selected = MouseUtil.getMouseOver(this.target, this.rotateVector.x, this.rotateVector.y, (double)(Float)this.attackRange.get());
        if (!(mc.player.getHealth() < 12.0F) || !this.autoPotion.isActive()) {
            if (this.selected != null && this.selected == this.target || mc.player.isElytraFlying()) {
                if (mc.player.isBlocking() && (Boolean)this.options.getValueByName("Отжимать щит").get()) {
                    mc.playerController.onStoppedUsingItem(mc.player);
                }

                this.stopWatch.setLastMS(50L);
                mc.playerController.attackEntity(mc.player, this.target);
                mc.player.swingArm(Hand.MAIN_HAND);
                LivingEntity var2 = this.target;
                if (var2 instanceof PlayerEntity) {
                    PlayerEntity player = (PlayerEntity)var2;
                    if ((Boolean)this.options.getValueByName("Ломать щит").get()) {
                        this.breakShieldPlayer(player);
                    }
                }

            }
        }
    }

    private boolean shouldPerformCriticalHit() {
        return !mc.player.isOnGround() && !mc.player.isInWater() && !mc.player.isInLava() && !mc.player.isElytraFlying() && !mc.player.isOnLadder() && !mc.player.isPassenger() && !mc.player.abilities.isFlying;
    }

    private boolean shouldPlayerFalling() {
        boolean cancelReason = mc.player.isInWater() && mc.player.areEyesInFluid(FluidTags.WATER) || mc.player.isInLava() || mc.player.isOnLadder() || mc.player.isPassenger() || mc.player.abilities.isFlying;
        boolean onSpace = mc.player.isOnGround() && !mc.gameSettings.keyBindJump.isKeyDown();
        float attackStrength = mc.player.getCooledAttackStrength((Boolean)this.options.getValueByName("Синхронизировать атаку с ТПС").get() ? nevernight.getInstance().getTpsCalc().getAdjustTicks() : 1.5F);
        if (attackStrength < 0.92F) {
            return false;
        } else if (!cancelReason && (Boolean)this.options.getValueByName("Криты с пробелом").get()) {
            return onSpace || !mc.player.isOnGround() && mc.player.fallDistance > 0.0F;
        } else if (!cancelReason && (Boolean)this.options.getValueByName("Только Криты").get()) {
            return !mc.player.isOnGround() && mc.player.fallDistance > 0.0F;
        } else {
            return true;
        }
    }

    private boolean isValid(LivingEntity entity) {
        if (entity instanceof ClientPlayerEntity) {
            return false;
        } else if (entity.ticksExisted < 3) {
            return false;
        } else if (mc.player.getDistanceEyePos(entity) > (double)(Float)this.attackRange.get() + (double)(Float)this.rotateDistance.get()) {
            return false;
        } else {
            if (entity instanceof PlayerEntity) {
                PlayerEntity p = (PlayerEntity)entity;
                if (AntiBot.isBot(entity)) {
                    return false;
                }

                if (!(Boolean)this.targets.getValueByName("Друзья").get() && FriendStorage.isFriend(p.getName().getString())) {
                    return false;
                }

                if (p.getName().getString().equalsIgnoreCase(mc.player.getName().getString())) {
                    return false;
                }
            }

            if (entity instanceof PlayerEntity && !(Boolean)this.targets.getValueByName("Игроки").get()) {
                return false;
            } else if (entity instanceof PlayerEntity && entity.getTotalArmorValue() == 0 && !(Boolean)this.targets.getValueByName("Голые").get()) {
                return false;
            } else if (entity instanceof PlayerEntity && entity.isInvisible() && entity.getTotalArmorValue() == 0 && !(Boolean)this.targets.getValueByName("Голые невидимки").get()) {
                return false;
            } else if (entity instanceof PlayerEntity && entity.isInvisible() && !(Boolean)this.targets.getValueByName("Невидимки").get()) {
                return false;
            } else if (entity instanceof MonsterEntity && !(Boolean)this.targets.getValueByName("Мобы").get()) {
                return false;
            } else if (entity instanceof AnimalEntity && !(Boolean)this.targets.getValueByName("Животные").get()) {
                return false;
            } else {
                return !entity.isInvulnerable() && entity.isAlive() && !(entity instanceof ArmorStandEntity);
            }
        }
    }

    private void breakShieldPlayer(PlayerEntity entity) {
        if (entity.isBlocking()) {
            int invSlot = InventoryUtil.getInstance().getAxeInInventory(false);
            int hotBarSlot = InventoryUtil.getInstance().getAxeInInventory(true);
            if (hotBarSlot == -1 && invSlot != -1) {
                int bestSlot = InventoryUtil.getInstance().findBestSlotInHotBar();
                mc.playerController.windowClick(0, invSlot, 0, ClickType.PICKUP, mc.player);
                mc.playerController.windowClick(0, bestSlot + 36, 0, ClickType.PICKUP, mc.player);
                mc.player.connection.sendPacket(new CHeldItemChangePacket(bestSlot));
                mc.playerController.attackEntity(mc.player, entity);
                mc.player.swingArm(Hand.MAIN_HAND);
                mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
                mc.playerController.windowClick(0, bestSlot + 36, 0, ClickType.PICKUP, mc.player);
                mc.playerController.windowClick(0, invSlot, 0, ClickType.PICKUP, mc.player);
            }

            if (hotBarSlot != -1) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(hotBarSlot));
                mc.playerController.attackEntity(mc.player, entity);
                mc.player.swingArm(Hand.MAIN_HAND);
                mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
            }
        }

    }

    private void reset() {
        if ((Boolean)this.options.getValueByName("Коррекция движения").get()) {
            mc.player.rotationYawOffset = -2.14748365E9F;
        }

        this.rotateVector = new Vector2f(mc.player.rotationYaw, mc.player.rotationPitch);
    }

    public void onEnable() {
        super.onEnable();
        this.reset();
        this.target = null;
    }

    public void onDisable() {
        super.onDisable();
        this.reset();
        this.stopWatch.setLastMS(0L);
        this.target = null;
    }

    private double getEntityArmor(PlayerEntity entityPlayer2) {
        double d2 = 0.0;

        for(int i2 = 0; i2 < 4; ++i2) {
            ItemStack is = (ItemStack)entityPlayer2.inventory.armorInventory.get(i2);
            if (is.getItem() instanceof ArmorItem) {
                d2 += this.getProtectionLvl(is);
            }
        }

        return d2;
    }

    private double getProtectionLvl(ItemStack stack) {
        Item var3 = stack.getItem();
        if (var3 instanceof ArmorItem i) {
            double damageReduceAmount = (double)i.getDamageReduceAmount();
            if (stack.isEnchanted()) {
                damageReduceAmount += (double)EnchantmentHelper.getEnchantmentLevel(Enchantments.PROTECTION, stack) * 0.25;
            }

            return damageReduceAmount;
        } else {
            return 0.0;
        }
    }

    private double getEntityHealth(LivingEntity ent) {
        if (ent instanceof PlayerEntity player) {
            return (double)(player.getHealth() + player.getAbsorptionAmount()) * (this.getEntityArmor(player) / 20.0);
        } else {
            return (double)(ent.getHealth() + ent.getAbsorptionAmount());
        }
    }

    public ModeSetting getType() {
        return this.type;
    }

    public ModeListSetting getOptions() {
        return this.options;
    }

    public StopWatch getStopWatch() {
        return this.stopWatch;
    }
}
И нахуя?
 
Забаненный
Статус
Оффлайн
Регистрация
10 Май 2023
Сообщения
825
Реакции[?]
9
Поинты[?]
3K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
/del килка из фуриоса
 
Начинающий
Статус
Оффлайн
Регистрация
31 Июл 2023
Сообщения
227
Реакции[?]
1
Поинты[?]
1K
сука это говно киллаура корорая нахуй не нужна /del нахуй это постят и одобряют
 
minced client
Read Only
Статус
Оффлайн
Регистрация
8 Май 2022
Сообщения
615
Реакции[?]
61
Поинты[?]
2K
Знаю что опенсурс
Но кому лень доставать держите
-
Code
KillAura:
//
// Source code recreated from a By Furious Client
//

package ua.nevernight.functions.impl.combat;

import com.google.common.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.item.ArmorStandEntity;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import ua.nevernight.nevernight;
import ua.nevernight.command.friends.FriendStorage;
import ua.nevernight.events.EventInput;
import ua.nevernight.events.EventMotion;
import ua.nevernight.events.EventUpdate;
import ua.nevernight.functions.api.Category;
import ua.nevernight.functions.api.Function;
import ua.nevernight.functions.api.FunctionRegister;
import ua.nevernight.functions.settings.Setting;
import ua.nevernight.functions.settings.impl.BooleanSetting;
import ua.nevernight.functions.settings.impl.ModeListSetting;
import ua.nevernight.functions.settings.impl.ModeSetting;
import ua.nevernight.functions.settings.impl.SliderSetting;
import ua.nevernight.utils.math.SensUtils;
import ua.nevernight.utils.math.StopWatch;
import ua.nevernight.utils.player.InventoryUtil;
import ua.nevernight.utils.player.MouseUtil;
import ua.nevernight.utils.player.MoveUtils;

@FunctionRegister(
    name = "KillAura",
    type = Category.Combat
)
public class FTaura extends Function {
    private final ModeSetting type = new ModeSetting("Тип", "Плавная", new String[]{"Плавная", "Резкая", "Незаметная", "FunTIme"});
    private final SliderSetting attackRange = new SliderSetting("Дистанция аттаки", 3.0F, 3.0F, 6.0F, 0.1F);
    private final SliderSetting rotateDistance = new SliderSetting("Дистанция ротации", 1.0F, 0.0F, 3.0F, 0.1F);
    private final BooleanSetting criticalHits = new BooleanSetting("Криты с места", false);
    final ModeListSetting targets = new ModeListSetting("Таргеты", new BooleanSetting[]{new BooleanSetting("Игроки", true), new BooleanSetting("Голые", true), new BooleanSetting("Мобы", false), new BooleanSetting("Животные", false), new BooleanSetting("Друзья", false), new BooleanSetting("Голые невидимки", true), new BooleanSetting("Невидимки", true)});
    final ModeListSetting options = new ModeListSetting("Опции", new BooleanSetting[]{new BooleanSetting("Только Криты", true), new BooleanSetting("Криты с пробелом", true), new BooleanSetting("Ломать щит", true), new BooleanSetting("Отжимать щит", true), new BooleanSetting("Синхронизировать атаку с ТПС", false), new BooleanSetting("Фокусировать одну цель", true), new BooleanSetting("Коррекция движения", true)});
    final ModeSetting correctionType = new ModeSetting("Тип коррекции", "Незаметный", new String[]{"Незаметный", "Сфокусированный"});
    private final StopWatch stopWatch = new StopWatch();
    private Vector2f rotateVector = new Vector2f(0.0F, 0.0F);
    private LivingEntity target;
    private Entity selected;
    int ticks = 0;
    boolean isRotated;
    final AutoPotion autoPotion;
    float lastYaw;
    float lastPitch;

    public FTaura(AutoPotion autoPotion) {
        this.autoPotion = autoPotion;
        this.addSettings(new Setting[]{this.type, this.attackRange, this.rotateDistance, this.targets, this.options, this.correctionType, this.criticalHits});
    }

    @Subscribe
    public void onInput(EventInput eventInput) {
        if (eventInput != null && (Boolean)this.options.getValueByName("Коррекция движения").get() && this.correctionType.is("Незаметный")) {
            MoveUtils.fixMovement(eventInput, this.rotateVector.x);
        }

    }

    @Subscribe
    public void onUpdate(EventUpdate e) {
        if ((Boolean)this.options.getValueByName("Фокусировать одну цель").get() && (this.target == null || !this.isValid(this.target)) || !(Boolean)this.options.getValueByName("Фокусировать одну цель").get()) {
            this.updateTarget();
        }

        if (this.target != null && (!this.autoPotion.isState() || !this.autoPotion.isActive())) {
            this.isRotated = false;
            if (this.shouldPlayerFalling() && this.stopWatch.hasTimeElapsed()) {
                this.updateAttack();
                this.ticks = 2;
            }

            if (this.type.is("Резкая")) {
                if (this.ticks > 0) {
                    this.updateRotation(true, 180.0F, 90.0F);
                    --this.ticks;
                } else {
                    this.reset();
                    --this.ticks;
                }
            } else if (!this.isRotated) {
                this.updateRotation(false, 80.0F, 35.0F);
            }

            if (this.shouldPlayerFalling() && this.stopWatch.hasTimeElapsed()) {
                this.updateAttack();
                this.ticks = 1;
            }

            if (this.type.is("Резкая")) {
                if (this.ticks > 0) {
                    this.updateRotation(true, 180.0F, 90.0F);
                } else {
                    this.reset();
                }
            }

            if (this.type.is("Незаметная") && this.ticks > 0) {
                this.updateRotation(true, 70.0F, 50.0F);
            }
        } else {
            this.stopWatch.setLastMS(0L);
            this.reset();
        }

    }

    public LivingEntity getTarget() {
        return this.target;
    }

    @Subscribe
    private void onWalking(EventMotion e) {
        if (this.target != null && (!this.autoPotion.isState() || !this.autoPotion.isActive())) {
            float yaw = this.rotateVector.x;
            float pitch = this.rotateVector.y;
            float headRot = mc.player.prevRotationYawHead;
            float maxHeadRot = 40.0F;
            float bodRot = mc.player.prevRotationYaw;
            float bodYaw;
            if (Math.abs(headRot - bodRot) > maxHeadRot) {
                if (headRot > bodRot) {
                    bodYaw = headRot + ThreadLocalRandom.current().nextFloat(1.0F, 15.0F);
                } else {
                    bodYaw = headRot - ThreadLocalRandom.current().nextFloat(1.0F, 15.0F);
                }
            } else {
                bodYaw = bodRot;
            }

            float newBodYaw = Math.min(Math.max(bodYaw, 0.0F), 10.0F);
            mc.player.renderYawOffset = bodYaw;
            mc.player.rotationYawHead = yaw;
            mc.player.rotationPitchHead = pitch;
            e.setYaw(yaw);
            e.setPitch(pitch);
        }

    }

    private void updateTarget() {
        List<LivingEntity> targets = new ArrayList();
        Iterator var2 = mc.world.getAllEntities().iterator();

        while(var2.hasNext()) {
            Entity entity = (Entity)var2.next();
            if (entity instanceof LivingEntity living) {
                if (this.isValid(living)) {
                    targets.add(living);
                }
            }
        }

        if (targets.isEmpty()) {
            this.target = null;
        } else if (targets.size() == 1) {
            this.target = (LivingEntity)targets.get(0);
        } else {
            targets.sort(Comparator.comparingDouble((object) -> {
                if (object instanceof PlayerEntity player) {
                    return -this.getEntityArmor(player);
                } else if (object instanceof LivingEntity base) {
                    return (double)(-base.getTotalArmorValue());
                } else {
                    return 0.0;
                }
            }).thenComparing((object, object2) -> {
                double d2 = this.getEntityHealth((LivingEntity)object);
                double d3 = this.getEntityHealth((LivingEntity)object2);
                return Double.compare(d2, d3);
            }).thenComparing((object, object2) -> {
                double d2 = (double)mc.player.getDistance((LivingEntity)object);
                double d3 = (double)mc.player.getDistance((LivingEntity)object2);
                return Double.compare(d2, d3);
            }));
            this.target = (LivingEntity)targets.get(0);
        }
    }

    private void updateRotation(boolean attack, float rotationYawSpeed, float rotationPitchSpeed) {
        Vector3d vec = this.target.getPositionVec().add(0.0, MathHelper.clamp(mc.player.getPosYEye() - this.target.getPosY(), 0.0, (double)this.target.getHeight() * (mc.player.getDistanceEyePos(this.target) / (double)(Float)this.attackRange.get())), 0.0).subtract(mc.player.getEyePosition(1.0F));
        this.isRotated = true;
        float yawToTarget = (float)MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(vec.z, vec.x)) - 90.0);
        float pitchToTarget = (float)(-Math.toDegrees(Math.atan2(vec.y, Math.hypot(vec.x, vec.z))));
        float yawDelta = MathHelper.wrapDegrees(yawToTarget - this.rotateVector.x);
        float pitchDelta = MathHelper.wrapDegrees(pitchToTarget - this.rotateVector.y);
        int roundedYaw = (int)yawDelta;
        float gcd;
        float clampedPitch;
        float yaw;
        float yawRandomness;
        float yaw;
        switch ((String)this.type.get()) {
            case "Плавная":
                gcd = Math.min(Math.max(Math.abs(yawDelta), 1.0F), rotationYawSpeed);
                clampedPitch = Math.min(Math.max(Math.abs(pitchDelta), 1.0F), rotationPitchSpeed);
                if (Math.abs(gcd - this.lastYaw) <= 2.0F) {
                    gcd = this.lastYaw + 2.1F;
                }

                yaw = this.rotateVector.x + (yawDelta > 0.0F ? gcd : -gcd);
                yawRandomness = MathHelper.clamp(this.rotateVector.y + (pitchDelta > 0.0F ? clampedPitch : -clampedPitch), -89.0F, 89.0F);
                yaw = SensUtils.getGCDValue();
                yaw -= (yaw - this.rotateVector.x) % yaw;
                yawRandomness -= (yawRandomness - this.rotateVector.y) % yaw;
                this.rotateVector = new Vector2f(yaw, yawRandomness);
                this.lastYaw = gcd;
                this.lastPitch = clampedPitch;
                if ((Boolean)this.options.getValueByName("Коррекция движения").get()) {
                    mc.player.rotationYawOffset = yaw;
                }
                break;
            case "Резкая":
                gcd = this.rotateVector.x + (float)roundedYaw;
                clampedPitch = MathHelper.clamp(this.rotateVector.y + pitchDelta, -90.0F, 90.0F);
                yaw = SensUtils.getGCDValue();
                gcd -= (gcd - this.rotateVector.x) % yaw;
                clampedPitch -= (clampedPitch - this.rotateVector.y) % yaw;
                this.rotateVector = new Vector2f(gcd, clampedPitch);
                if ((Boolean)this.options.getValueByName("Коррекция движения").get()) {
                    mc.player.rotationYawOffset = gcd;
                }
                break;
            case "Незаметная":
                gcd = SensUtils.getGCDValue();
                clampedPitch = 0.0F;
                yaw = 0.0F;
                if (!((double)mc.player.fallDistance <= 0.6)) {
                    return;
                }

                yawRandomness = (float)(Math.random() * 14.0 - 7.0);
                yaw = this.rotateVector.x + (float)roundedYaw + yawRandomness;
                float pitchRandomness = (float)(Math.random() * 2.0 - 5.0);
                float pitch = MathHelper.clamp(this.rotateVector.y + pitchDelta + pitchRandomness, -90.0F, 90.0F);
                yaw -= (yaw - this.rotateVector.x) % gcd;
                pitch -= (pitch - this.rotateVector.y) % gcd;
                this.rotateVector = new Vector2f(yaw, pitch);
                mc.player.rotationYaw = this.rotateVector.x;
                mc.player.rotationPitch = this.rotateVector.y;
        }

    }

    private void updateAttack() {
        this.selected = MouseUtil.getMouseOver(this.target, this.rotateVector.x, this.rotateVector.y, (double)(Float)this.attackRange.get());
        if (!(mc.player.getHealth() < 12.0F) || !this.autoPotion.isActive()) {
            if (this.selected != null && this.selected == this.target || mc.player.isElytraFlying()) {
                if (mc.player.isBlocking() && (Boolean)this.options.getValueByName("Отжимать щит").get()) {
                    mc.playerController.onStoppedUsingItem(mc.player);
                }

                this.stopWatch.setLastMS(50L);
                mc.playerController.attackEntity(mc.player, this.target);
                mc.player.swingArm(Hand.MAIN_HAND);
                LivingEntity var2 = this.target;
                if (var2 instanceof PlayerEntity) {
                    PlayerEntity player = (PlayerEntity)var2;
                    if ((Boolean)this.options.getValueByName("Ломать щит").get()) {
                        this.breakShieldPlayer(player);
                    }
                }

            }
        }
    }

    private boolean shouldPerformCriticalHit() {
        return !mc.player.isOnGround() && !mc.player.isInWater() && !mc.player.isInLava() && !mc.player.isElytraFlying() && !mc.player.isOnLadder() && !mc.player.isPassenger() && !mc.player.abilities.isFlying;
    }

    private boolean shouldPlayerFalling() {
        boolean cancelReason = mc.player.isInWater() && mc.player.areEyesInFluid(FluidTags.WATER) || mc.player.isInLava() || mc.player.isOnLadder() || mc.player.isPassenger() || mc.player.abilities.isFlying;
        boolean onSpace = mc.player.isOnGround() && !mc.gameSettings.keyBindJump.isKeyDown();
        float attackStrength = mc.player.getCooledAttackStrength((Boolean)this.options.getValueByName("Синхронизировать атаку с ТПС").get() ? nevernight.getInstance().getTpsCalc().getAdjustTicks() : 1.5F);
        if (attackStrength < 0.92F) {
            return false;
        } else if (!cancelReason && (Boolean)this.options.getValueByName("Криты с пробелом").get()) {
            return onSpace || !mc.player.isOnGround() && mc.player.fallDistance > 0.0F;
        } else if (!cancelReason && (Boolean)this.options.getValueByName("Только Криты").get()) {
            return !mc.player.isOnGround() && mc.player.fallDistance > 0.0F;
        } else {
            return true;
        }
    }

    private boolean isValid(LivingEntity entity) {
        if (entity instanceof ClientPlayerEntity) {
            return false;
        } else if (entity.ticksExisted < 3) {
            return false;
        } else if (mc.player.getDistanceEyePos(entity) > (double)(Float)this.attackRange.get() + (double)(Float)this.rotateDistance.get()) {
            return false;
        } else {
            if (entity instanceof PlayerEntity) {
                PlayerEntity p = (PlayerEntity)entity;
                if (AntiBot.isBot(entity)) {
                    return false;
                }

                if (!(Boolean)this.targets.getValueByName("Друзья").get() && FriendStorage.isFriend(p.getName().getString())) {
                    return false;
                }

                if (p.getName().getString().equalsIgnoreCase(mc.player.getName().getString())) {
                    return false;
                }
            }

            if (entity instanceof PlayerEntity && !(Boolean)this.targets.getValueByName("Игроки").get()) {
                return false;
            } else if (entity instanceof PlayerEntity && entity.getTotalArmorValue() == 0 && !(Boolean)this.targets.getValueByName("Голые").get()) {
                return false;
            } else if (entity instanceof PlayerEntity && entity.isInvisible() && entity.getTotalArmorValue() == 0 && !(Boolean)this.targets.getValueByName("Голые невидимки").get()) {
                return false;
            } else if (entity instanceof PlayerEntity && entity.isInvisible() && !(Boolean)this.targets.getValueByName("Невидимки").get()) {
                return false;
            } else if (entity instanceof MonsterEntity && !(Boolean)this.targets.getValueByName("Мобы").get()) {
                return false;
            } else if (entity instanceof AnimalEntity && !(Boolean)this.targets.getValueByName("Животные").get()) {
                return false;
            } else {
                return !entity.isInvulnerable() && entity.isAlive() && !(entity instanceof ArmorStandEntity);
            }
        }
    }

    private void breakShieldPlayer(PlayerEntity entity) {
        if (entity.isBlocking()) {
            int invSlot = InventoryUtil.getInstance().getAxeInInventory(false);
            int hotBarSlot = InventoryUtil.getInstance().getAxeInInventory(true);
            if (hotBarSlot == -1 && invSlot != -1) {
                int bestSlot = InventoryUtil.getInstance().findBestSlotInHotBar();
                mc.playerController.windowClick(0, invSlot, 0, ClickType.PICKUP, mc.player);
                mc.playerController.windowClick(0, bestSlot + 36, 0, ClickType.PICKUP, mc.player);
                mc.player.connection.sendPacket(new CHeldItemChangePacket(bestSlot));
                mc.playerController.attackEntity(mc.player, entity);
                mc.player.swingArm(Hand.MAIN_HAND);
                mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
                mc.playerController.windowClick(0, bestSlot + 36, 0, ClickType.PICKUP, mc.player);
                mc.playerController.windowClick(0, invSlot, 0, ClickType.PICKUP, mc.player);
            }

            if (hotBarSlot != -1) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(hotBarSlot));
                mc.playerController.attackEntity(mc.player, entity);
                mc.player.swingArm(Hand.MAIN_HAND);
                mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
            }
        }

    }

    private void reset() {
        if ((Boolean)this.options.getValueByName("Коррекция движения").get()) {
            mc.player.rotationYawOffset = -2.14748365E9F;
        }

        this.rotateVector = new Vector2f(mc.player.rotationYaw, mc.player.rotationPitch);
    }

    public void onEnable() {
        super.onEnable();
        this.reset();
        this.target = null;
    }

    public void onDisable() {
        super.onDisable();
        this.reset();
        this.stopWatch.setLastMS(0L);
        this.target = null;
    }

    private double getEntityArmor(PlayerEntity entityPlayer2) {
        double d2 = 0.0;

        for(int i2 = 0; i2 < 4; ++i2) {
            ItemStack is = (ItemStack)entityPlayer2.inventory.armorInventory.get(i2);
            if (is.getItem() instanceof ArmorItem) {
                d2 += this.getProtectionLvl(is);
            }
        }

        return d2;
    }

    private double getProtectionLvl(ItemStack stack) {
        Item var3 = stack.getItem();
        if (var3 instanceof ArmorItem i) {
            double damageReduceAmount = (double)i.getDamageReduceAmount();
            if (stack.isEnchanted()) {
                damageReduceAmount += (double)EnchantmentHelper.getEnchantmentLevel(Enchantments.PROTECTION, stack) * 0.25;
            }

            return damageReduceAmount;
        } else {
            return 0.0;
        }
    }

    private double getEntityHealth(LivingEntity ent) {
        if (ent instanceof PlayerEntity player) {
            return (double)(player.getHealth() + player.getAbsorptionAmount()) * (this.getEntityArmor(player) / 20.0);
        } else {
            return (double)(ent.getHealth() + ent.getAbsorptionAmount());
        }
    }

    public ModeSetting getType() {
        return this.type;
    }

    public ModeListSetting getOptions() {
        return this.options;
    }

    public StopWatch getStopWatch() {
        return this.stopWatch;
    }
}
Пошёл нахуй со своей экспенсив аурой, и нищим ренеймом бля)
 
Забаненный
Статус
Оффлайн
Регистрация
10 Май 2023
Сообщения
825
Реакции[?]
9
Поинты[?]
3K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Сверху Снизу