Исходник DeObf KillAura Obrigalik

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

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

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

Спасибо!

(помощник) кодера был слишком выёбчивым и тупым и я сливаю вам это горе пасто килку ,если хотите солью худ :da:

Код:
import net.minecraft.EnchantmentHelper;
import net.minecraft.Entity;
import net.minecraft.ItemStack;
import net.minecraft.Player;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.Mouse;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.Matrix4f;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.util.math.Vector3d;
import net.minecraft.client.util.math.Vector3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.goal.GoalSelector;
import net.minecraft.entity.ai.goal.MoveTowardsRestriction;
import net.minecraft.entity.ai.goal.MoveTowardsTarget;
import net.minecraft.entity.ai.goal.PrioritizedGoal;
import net.minecraft.entity.player.PlayerAbilities;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.PacketPlayInArmAnimation;
import net.minecraft.network.packet.c2s.PacketPlayInBlockPlace;
import net.minecraft.network.packet.c2s.PacketPlayInUseItem;
import net.minecraft.network.packet.c2s.PacketPlayInSteerVehicle;
import net.minecraft.network.packet.c2s.PacketPlayInWindowClick;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.RecipeType;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.TypedActionResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import ru.vorkis.Aura;
import ru.vorkis.AuraConfig;
import ru.vorkis.functions.settings.Setting;
import ru.vorkis.functions.settings.SettingsManager;
import ru.vorkis.functions.settings.impl.ModeListSetting;
import ru.vorkis.functions.settings.impl.BooleanSetting;
import ru.vorkis.functions.settings.impl.ModeSetting;
import ru.vorkis.functions.settings.impl.SliderSetting;
import ru.vorkis.functions.api.Category;
import ru.vorkis.functions.api.FunctionRegister;
import ru.vorkis.functions.api.Function;
import ru.vorkis.Main;
import ru.vorkis.utils.Timer;
import ru.vorkis.utils.TimerUtil;
import ru.vorkis.utils.TimerUtil.TimeType;
import ru.vorkis.utils.misc.MathUtils;
import ru.vorkis.utils.misc.TimerUtils;
import ru.vorkis.utils.PlayerUtils;
import ru.vorkis.utils.PlayerUtils.InputManager;
import ru.vorkis.utils.PlayerUtils.RenderManager;
import ru.vorkis.utils.events.AttackTimerEvent;
import ru.vorkis.utils.events.InputEvent;
import ru.vorkis.utils.events.RenderEvent;
import ru.vorkis.utils.events.UpdateEvent;
import ru.vorkis.utils.events.VisualRotateEvent;
import ru.vorkis.utils.events.WeaponSwapEvent;
import com.google.common.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import net.minecraft.client.render.Camera.CameraProjection;

@FunctionRegister(
    name = "Aura",
    type = Category.COMBAT
)
public class Aura extends Function {

public float rotationSpeed = 0.0f;
public SliderSetting rotateDistance;
public boolean isReversing = false;
public ModeSetting rotationMode = new ModeSetting(
    "forward",
    "back",
    "reverse",
    "strafe"
);
public SliderSetting elytrarotate;
public float lastYaw;
private final float maxRotationSpeed = 1.5f;
public BooleanSetting smartCorrection;
private final float acceleration = 0.01f;
public float rotationAngle = 0.0f;
public SliderSetting distance;
public ModeListSetting settings;
private ModeSetting sortMode = new ModeSetting(
    "Normal",
    "Top",
    "Bottom",
    "Top",
    "Bottom"
);
private long cpsLimit = 0L;
private TimerUtil stopWatch;
private Vector3f fakePrevRotateVector;
private Vector3f fakeRotateVector;
private boolean hasRotated;
public Entity target;
public float ticksUntilNextAttack;
public BooleanSetting onlySpaceCritical;
public BooleanSetting predictCritical;
public ModeListSetting targets = new ModeListSetting(
    "Closest",
    new BooleanSetting("No_Shield", true),
    new BooleanSetting("No_Abilities", false),
    new BooleanSetting("No_Potions", true),
    new BooleanSetting("No_Enchant", false),
    new BooleanSetting("No_Projectiles", false)
);
public ModeSetting correctionType;
public float lastPitch;
public Vector3f rotate;

   static float getYaw(Entity entity) {
    return entity.rotationYaw;
}

    private void attackTarget(Entity targetEntity) {
        if (((Boolean)getSettingValue("critical_anti_cooldown")).booleanValue() && MinecraftServer.getServer().playerInteractionManager.isBlocking(Minecraft.get HillePlayer())) {
            Callback.onStoppedUsingItem(Item.getIdFromItem(Minecraft.getHillePlayer().getItemInHand(Hand.MAIN_HAND)));
        }
        boolean sentPacket = false;
        if (Minecraft.getFrameWorld().isClient && !Minecraft.getHillePlayer().isOnGround() && !Minecraft.getHillePlayer().isTouchingWater()) {
            Minecraft.getNetworkHandler().sendPacket(new CPlayerPacket(Packets.PLAY_CLIENTbound.ON_USE_ENTITY, Minecraft.getHillePlayer().getId()));
            sentPacket = true;
        }
        long time = Minecraft.isOnServer ? System.currentTimeMillis() : System.currentTimeMillis() + 550;
        Callback.attackEntity(targetEntity, Minecraft.getHillePlayer());
        Minecraft.getHillePlayer().swingHand(Hand.MAIN_HAND);
        if (((Boolean)getSettingValue("break_shield")).booleanValue()) {
            this.breakShieldAndSwapSlot();
        }
        if (sentPacket) {
            Minecraft.getNetworkHandler().sendPacket(new CPlayerPacket(Packets.PLAY_CLIENTbound.ANIMATION, Minecraft.getHillePlayer().getId(), Minecraft.getHillePlayer().getMainArm().getId(), EnumHand.MAIN_HAND));
        }
    }

    public int breakShield(AttackSource source) {
    int axeSlot = inventory.getAxe(true);
    if (axeSlot != -1) {
        packetSender.sendPacket(new UseItemPacket(axeSlot));
        attackSource.attackEntity(getTarget(), sourceType);
        armSwing.swingArm();
        packetSender.sendPacket(new UseItemPacket(useItem(getOffhandSlot(isEating()))));
        return axeSlot;
    }
    axeSlot = inventory.getAxe(false);
    if (axeSlot != -1) {
        itemInteracter.pickItem(axeSlot);
        attackSource.attackEntity(getTarget(), sourceType);
        armSwing.swingArm();
        return axeSlot;
    }
    return -1;
}
    private void handleMotionEvent(MotionEvent event) {
    if (event == null || Main.getInst().getFunctionRegistry().getAutoPotion().isActive()) {
        return;
    }
    event.setYaw(getYaw(event.getPointerId(0)));
    event.setPitch(getPitch(event.getPointerId(1)));
    Aura.setX(getX(Aura.getPointerId(0)), getX(Aura.getPointerId(1)));
    Aura.setY(getY(Aura.getPointerId(0)), getY(Aura.getPointerId(1)));
    Aura.setPressure(getPressure(Aura.getPointerId(0)), getPressure(Aura.getPointerId(1)));
}
public static float rotate(float current, float target, float min, float max) {
    float delta = Math.copySign(Math.min(0.6f, Math.abs(target - current)), target - current);
    delta = Math.min(delta, Math.abs(min)) * Math.signum(min);
    delta = Math.min(delta, Math.abs(max)) * Math.signum(max);
    if (Math.abs(delta) > Math.abs(target - current)) {
        return target;
    }
    return current + delta;
}
private void findTarget() {
    List<Entity> entities = new ArrayList<>();
    for (Entity entity : getSortedTargets()) {
        if (!(entity instanceof LivingEntity) || !isValidTarget((LivingEntity) entity)) continue;
        entities.add(entity);
    }
    if (entities.isEmpty()) {
        setTarget(null);
        return;
    }
    if (entities.size() == 1) {
        setTarget((LivingEntity) entities.get(0));
        return;
    }
    entities.sort(Comparator.comparingDouble(entity -> {
        if (entity instanceof Player) {
            Player player = (Player) entity;
            return -getEntityArmor(player);
        }
        if (entity instanceof LivingEntity) {
            LivingEntity livingEntity = (LivingEntity) entity;
            return -livingEntity.getTotalArmorValue();
        }
        return 0.0;
    }).thenComparing((entity, entity2) -> {
        double health1 = getEntityHealth(entity);
        double health2 = getEntityHealth(entity2);
        return Double.compare(health1, health2);
    }).thenComparing((entity, entity2) -> {
        double distance1 = getEntityDistance(entity);
        double distance2 = getEntityDistance(entity2);
        return Double.compare(distance1, distance2);
    }));
    setTarget((LivingEntity) entities.get(0));
}
@Subscribe
private void onUpdate(UpdateEvent event) {
    if (getCurrentTarget() != null) {
        updateRotation();
        setTargetRotation(new Vector3f(wrapDegrees(getYaw() + 25.0f), getPitch(), 0.0f), 40.0f);
    }
    if (getTarget() == null || !isValidTarget(getTarget())) {
        findTarget();
    }
    if (getAttackTimer() == null) {
        setAttackTimer(this, System.currentTimeMillis());
        setTargetRotation(new Vector3f(smoothStep(getYaw(), getTargetYaw(), getSmoothness()), getSmoothStep(getPitch(), getTargetPitch()), 0.0f), Aura.getSmoothness());
        return;
    }
    attackAndRotateOnEntity(getTarget());
}
private boolean canSeeThroughWall(Entity entity) {
    return getPlayer().canEntityBeSeen(entity);
}

@Subscribe
public void onInput(InputEvent event) {
    if (getSetting(this).getValueByName("enable").getAsBoolean() && getPlayer().getInputManager().getIndex() == 0 && !isInWater()) {
        getJump().fixMovement(event, getPlayerController());
    }
}
public Aura() {
    this.settings = new ModeListSetting("Rotations", new BooleanSetting("Strafe", true), new BooleanSetting("Reverse", true), new BooleanSetting("Shield", true), new BooleanSetting("Abilities", true), new BooleanSetting("Potions", true), new BooleanSetting("Enchant", true));
    this.distance = new SliderSetting("Distance", 3.0f, 2.5f, 6.0f, 0.1f);
    this.rotateDistance = new SliderSetting("Rotate Distance", 1.5f, 0.0f, 3.0f, 0.1f);
    this.elytrarotate = new SliderSetting("Elytra Rotate", 1.0f, 0.0f, 30.0f, 0.05f);
    this.onlySpaceCritical = new BooleanSetting("Space Criticals", false).setVisible(() -> getSetting(this).getValueByName("Strafe").getAsBoolean());
    this.correctionType = new ModeSetting("Correction", "None", "Simple", "Smart", "Packet").setVisible(() -> getSetting(this).getValueByName("Shield").getAsBoolean());
    this.smartCorrection = new BooleanSetting("Smart Correction", false).setVisible(() -> getModeListSetting(this).is("Packet"));
    this.predictCritical = new BooleanSetting("Predict Criticals", true);
    this.stopWatch = new TimerUtil();
    this.addSettings(this.rotationMode, this.targets, this.sortMode, this.distance, this.rotateDistance, this.elytrarotate, this.settings, this.correctionType, this.onlySpaceCritical, this.smartCorrection, this.predictCritical);
}
public boolean canAttack() {
    boolean isOnGround = getPlayerController().isOnGround();
    boolean isMeleeKeyDown = getInputManager().isKeyDown();
    boolean isBow = isMeleeKeyDown && getSetting(this).get() && !getCriticalManager().isState();
    boolean isPotions = getPotionManager().isPotionActive(getPotionManager().getSpeed()) || getPotionManager().isPotionActive(getPotionManager().getStrength()) && getPlayerController().getCooledAttackStrength(1.5f) > 0.0f;
    boolean isOther = isOnLadder() || isInWater() && areEyesInFluid(isUnderwaterVision()) || isRidingHorse() || isInWeb() || isElytraFlying() || isInLava() && areEyesInFluid(isUnderlavaVision());
    if (getEntityDistance(getTarget()) <= (double)getSetting(this).get() && (isSwimming() ? getPlayerController().getCooledAttackStrength(1.5f) == 1.0f : getPlayerController().getCooledAttackStrength(1.5f) >= 0.93f)) {
        if (!isBow && getSettings(this).getValueByName("Shield").getAsBoolean()) {
            return isOnGround || !isState() && getSpeed() > 0.0f || isState() && !isBow();
        }
        return true;
    }
    return false;
}

@Subscribe
private void onRender(RenderEvent event) {
}
private void attackAndRotateOnEntity(LivingEntity livingEntity) {
    boolean isElytraFlying = getPlayerController().isElytraFlying();
    if (getPlayerController().getInputManager().getIndex() == 1 && !isElytraFlying) {
        if (shouldAttack(livingEntity)) {
            attackTarget(livingEntity);
            updateTimer(2.0f);
        }
        if (getAttackTimer() > 0.0f) {
            updateRotation(2.1474836E9f);
            setTargetRotation(getTargetRotation() - 1.0f);
        } else {
            resetRotation();
            setTargetRotation(getRotation() - 1.0f);
        }
    }
    if (getPlayerController().getInputManager().getIndex() == 0 || isElytraFlying) {
        if (shouldAttack(livingEntity)) {
            attackTarget(livingEntity);
        }
        if (!rayTraceSingleEntity(getRenderManager(), getEntity(livingEntity), getSetting(this).get(), livingEntity)) {
            updateRotation(9999.0f);
        }
    }
}
public void updateRotation() {
    if (!isRotationPaused(this)) {
        setTargetRotation(getTargetRotation() + 0.01f);
        if (getPitch(this) > 2.3) {
            setTargetRotation(2.3f);
            setRotationPaused(this, true);
        }
    } else {
        setTargetRotation(getTargetRotation() - 0.01f);
        if (getPitch(this) < -2.3) {
            setTargetRotation(-2.3f);
            setRotationPaused(this, false);
        }
    }
    setYaw(getYaw(this) + getRotationSpeed());
    setYaw(getWrappedYaw(this));
}
private void updateRotation(final float n) {
    if (shouldRotate(this)) {
        final Vector3d add = getPlayer().getPositionVec().add(0.0, Math.clamp(getRenderManager().getPosY() - getPlayer().getHeight(), 0.0, (double)(getPlayer().getHeight() / 2.0f)), 0.0).subtract(getRenderManager().getEyePosition(1.0f)).add(getPlayerController().getMotion().mul((getPlayerController().isElytraFlying() && getPlayerController().isElytraFlying()) ? 3.0 : 0.2, (getMainHandItem().isElytra() && getOffhandItem().isElytra()) ? 3.0 : 0.2, (getInventory().getArmorItem().isElytra() && getInventory().getArmorItem().isElytra()) ? 3.0 : 0.2));
        final float n2 = (float)wrapDegrees(Math.toDegrees(Math.atan2(add.x, add.z)) - 90.0);
        final float n3 = (float)(-Math.toDegrees(Math.atan2(add.x, Math.hypot(add.z, add.y))));
        final float wrapDegrees = wrapDegrees(n2 - getYaw());
        final float wrapDegrees2 = wrapDegrees(n3 - getPitch());
        final int n4 = (int)wrapDegrees;
        final String s = getModeListSetting(this).get();
        int n5 = -1;
        switch (s.hashCode()) {
            case 1337024415: {
                if (s.equals("Packet")) {
                    n5 = 0;
                    break;
                }
                break;
            }
            case -812015109: {
                if (s.equals("None")) {
                    n5 = 1;
                    break;
                }
                break;
            }
        }
        switch (n5) {
            case 0: {
                final float min = Math.min(Math.max(Math.abs(wrapDegrees), 1.0f), n);
                final float max = Math.max(Math.abs(wrapDegrees2), 1.0f);
                final float n6 = getRotationSpeed() + ((wrapDegrees > 0.0f) ? min : (-min)) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
                final float n7 = Math.clamp(getRotation() + ((wrapDegrees2 > 0.0f) ? max : (-max)), -89.0f, 89.0f) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
                setTargetRotation(new Vector3f(n6 - (n6 - getGCDValue()), n7 - (n7 - getGCDValue())));
                setMin(min);
                setMax(max);
                break;
            }
            case 1: {
                final float n8 = getYaw() + n4;
                final float clamp = Math.clamp(getPitch() + wrapDegrees2, -90.0f, 90.0f);
                final float gcdValue = getGCDValue();
                setTargetRotation(new Vector3f(n8 - (n8 - getGCDValue()), clamp - (clamp - getGCDValue())));
                break;
            }
        }
    }
    else {
    final Vector3d subtract = getPlayer().getPositionVec().add(0.0, Math.clamp(getRenderManager().getPosY() - getPlayer().getHeight(), 0.0, (double)(getPlayer().getHeight() / 2.0f)), 0.0).subtract(getRenderManager().getEyePosition(1.0f));
    final float n9 = (float)wrapDegrees(Math.toDegrees(Math.atan2(subtract.x, subtract.z)) - 90.0);
    final float n10 = (float)(-Math.toDegrees(Math.atan2(subtract.x, Math.hypot(subtract.z, subtract.y))));
    final float wrapDegrees3 = wrapDegrees(n9 - getYaw());
    final float wrapDegrees4 = wrapDegrees(n10 - getPitch());
    final int n11 = (int)wrapDegrees3;
    final String s2 = getModeListSetting(this).get();
    int n12 = -1;
    switch (s2.hashCode()) {
        case 1337024415: {
            if (s2.equals("Packet")) {
                n12 = 0;
                break;
            }
            break;
        }
        case -812015109: {
            if (s2.equals("None")) {
                n12 = 1;
                break;
            }
            break;
        }
    }
    switch (n12) {
        case 0: {
            final float min2 = Math.min(Math.max(Math.abs(wrapDegrees3), 1.0f), n);
            final float max2 = Math.max(Math.abs(wrapDegrees4), partum);
            final float n13 = getRotationSpeed() + ((wrapDegrees3 > 0.0f) ? min2 : (-min2)) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
            final float n14 = Math.clamp(getRotation() + ((wrapDegrees4 > 0.0f) ? max2 : (-max2)), -89.0f, 89.0f) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
            setTargetRotation(new Vector3f(n13 - (n13 - getGCDValue()), n14 - (n14 - getGCDValue())));
            setMin(min2);
            setMax(max2);
            break;
        }
        case 1: {
            final float n15 = getYaw() + n11;
            final float clamp2 = Math.clamp(getPitch() + wrapDegrees4, -90.0f, 90.0f);
            final float gcdValue2 = getGCDValue();
            setTargetRotation(new Vector3f(n15 - (n15 - getGCDValue()), clamp2 - (clamp2 - getGCDValue())));
            break;
        }
    }
}
}
public static Vector3d getVector(final Entity entity) {
    final double n = entity.getWidth() * entity.getWidth() * entity.getWidth() * entity.getWidth();
    return new Vector3d(entity.getPosX() - getPlayer().getPosX() + Math.clamp(getRenderManager().getPosX() - entity.getPosX(), -n, n), entity.getPosY() - getPlayer().getPosYEye() + Math.clamp(entity.getPosYEye() - entity.getPosY(), 0.0, entity.getHeight() / 1.7), entity.getPosZ() - getPlayer().getPosZ() + Math.clamp(getRenderManager().getPosZ() - entity.getPosZ(), -n, n));
}
@Subscribe
private void onVisualRotate(final RotationEvent event) {
    if (!(event.getEntity() instanceof Entity)) {
        return;
    }
    if (getAttackTimer() == null) {
        return;
    }
}
private /* synthetic */ double lambda$findTarget$3(final Object o) {
    if (o instanceof final Player player) {
        return -getEntityArmor(player);
    }
    if (o instanceof final LivingEntity livingEntity) {
        return -livingEntity.getTotalArmorValue();
    }
    return 0.0;
}
private void breakShieldAndSwapSlot() {
    final Entity entity = getTarget();
    if (entity instanceof final Player player) {
        if (getFunctionRegistry().getAutoPotion().isActive() && !player.isSpectator() && !player.isCreative() && (getInventory().getHeldItemOffhand().getItem() == getFunctionRegistry().getShield() || getInventory().getHeldItemMainhand().getItem() == getFunctionRegistry().getSword())) {
            final int breakShield = this.breakShield((LivingEntity) player);
            if (breakShield > 8) {
                getPlayerController().pickItem(breakShield);
            }
        }
    }
}
private double getDistance(final Entity entity) {
    return getVector(entity).length();
}

private double getProtectionLvl(final ItemStack itemStack) {
    double n = itemStack.getDamageReduceAmount();
    if (itemStack.isEnchanted()) {
        n += EnchantmentHelper.getEnchantmentLevel(getFunctionRegistry().getProtection(), itemStack) * 0.25;
    }
    return n;
}
private static void setRenderYawOffset(final Entity entity, final float renderYawOffset) {
    entity.renderYawOffset = renderYawOffset;
}
static {
    Aura.target = null;
    Aura.fakeRotateVector = new Vector3f(0.0f, 0.0f);
    Aura.fakePrevRotateVector = new Vector3f(0.0f, 0.0f);
    Aura.rotate = new Vector3f(0.0f, 0.0f);
}
public double getEntityArmor(final Player player) {
    double n = 0.0;
    for (final ItemStack itemStack : getPlayer().getArmorItems()) {
        if (itemStack != null && itemStack.getItem() instanceof ArmorItem) {
            n += this.getProtectionLvl(itemStack);
        }
    }
    return n;
}
@Override
public void onDisable() {
    setTargetRotation(new Vector3f(getRenderManager().getRenderYawOffset(getPlayer()), getRenderManager().getRenderPitchOffset(getPlayer())));
    setTarget(null);
    setAttackTimer(null);
    setAttackTimer(this, System.currentTimeMillis());
    super.onDisable();
}
public double getEntityHealth(final Entity entity) {
    if (entity instanceof final Player player) {
        return (player.getHealth() + player.getAbsorptionAmount()) * (this.getEntityArmor(player) / 20.0);
    }
    if (entity instanceof final LivingEntity livingEntity) {
        return livingEntity.getHealth() + livingEntity.getAbsorptionAmount();
    }
    return 0.0;
}
}
 
Начинающий
Статус
Оффлайн
Регистрация
1 Янв 2024
Сообщения
29
Реакции[?]
0
Поинты[?]
0
база 2.0? ждём худ)
/del модуль со слитого рогалика
 
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
12 Июн 2024
Сообщения
470
Реакции[?]
1
Поинты[?]
1K
(помощник) кодера был слишком выёбчивым и тупым и я сливаю вам это горе пасто килку ,если хотите солью худ :da:

Код:
import net.minecraft.EnchantmentHelper;
import net.minecraft.Entity;
import net.minecraft.ItemStack;
import net.minecraft.Player;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.Mouse;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.Matrix4f;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.util.math.Vector3d;
import net.minecraft.client.util.math.Vector3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.goal.GoalSelector;
import net.minecraft.entity.ai.goal.MoveTowardsRestriction;
import net.minecraft.entity.ai.goal.MoveTowardsTarget;
import net.minecraft.entity.ai.goal.PrioritizedGoal;
import net.minecraft.entity.player.PlayerAbilities;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.PacketPlayInArmAnimation;
import net.minecraft.network.packet.c2s.PacketPlayInBlockPlace;
import net.minecraft.network.packet.c2s.PacketPlayInUseItem;
import net.minecraft.network.packet.c2s.PacketPlayInSteerVehicle;
import net.minecraft.network.packet.c2s.PacketPlayInWindowClick;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.RecipeType;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.TypedActionResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import ru.vorkis.Aura;
import ru.vorkis.AuraConfig;
import ru.vorkis.functions.settings.Setting;
import ru.vorkis.functions.settings.SettingsManager;
import ru.vorkis.functions.settings.impl.ModeListSetting;
import ru.vorkis.functions.settings.impl.BooleanSetting;
import ru.vorkis.functions.settings.impl.ModeSetting;
import ru.vorkis.functions.settings.impl.SliderSetting;
import ru.vorkis.functions.api.Category;
import ru.vorkis.functions.api.FunctionRegister;
import ru.vorkis.functions.api.Function;
import ru.vorkis.Main;
import ru.vorkis.utils.Timer;
import ru.vorkis.utils.TimerUtil;
import ru.vorkis.utils.TimerUtil.TimeType;
import ru.vorkis.utils.misc.MathUtils;
import ru.vorkis.utils.misc.TimerUtils;
import ru.vorkis.utils.PlayerUtils;
import ru.vorkis.utils.PlayerUtils.InputManager;
import ru.vorkis.utils.PlayerUtils.RenderManager;
import ru.vorkis.utils.events.AttackTimerEvent;
import ru.vorkis.utils.events.InputEvent;
import ru.vorkis.utils.events.RenderEvent;
import ru.vorkis.utils.events.UpdateEvent;
import ru.vorkis.utils.events.VisualRotateEvent;
import ru.vorkis.utils.events.WeaponSwapEvent;
import com.google.common.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import net.minecraft.client.render.Camera.CameraProjection;

@FunctionRegister(
    name = "Aura",
    type = Category.COMBAT
)
public class Aura extends Function {

public float rotationSpeed = 0.0f;
public SliderSetting rotateDistance;
public boolean isReversing = false;
public ModeSetting rotationMode = new ModeSetting(
    "forward",
    "back",
    "reverse",
    "strafe"
);
public SliderSetting elytrarotate;
public float lastYaw;
private final float maxRotationSpeed = 1.5f;
public BooleanSetting smartCorrection;
private final float acceleration = 0.01f;
public float rotationAngle = 0.0f;
public SliderSetting distance;
public ModeListSetting settings;
private ModeSetting sortMode = new ModeSetting(
    "Normal",
    "Top",
    "Bottom",
    "Top",
    "Bottom"
);
private long cpsLimit = 0L;
private TimerUtil stopWatch;
private Vector3f fakePrevRotateVector;
private Vector3f fakeRotateVector;
private boolean hasRotated;
public Entity target;
public float ticksUntilNextAttack;
public BooleanSetting onlySpaceCritical;
public BooleanSetting predictCritical;
public ModeListSetting targets = new ModeListSetting(
    "Closest",
    new BooleanSetting("No_Shield", true),
    new BooleanSetting("No_Abilities", false),
    new BooleanSetting("No_Potions", true),
    new BooleanSetting("No_Enchant", false),
    new BooleanSetting("No_Projectiles", false)
);
public ModeSetting correctionType;
public float lastPitch;
public Vector3f rotate;

   static float getYaw(Entity entity) {
    return entity.rotationYaw;
}

    private void attackTarget(Entity targetEntity) {
        if (((Boolean)getSettingValue("critical_anti_cooldown")).booleanValue() && MinecraftServer.getServer().playerInteractionManager.isBlocking(Minecraft.get HillePlayer())) {
            Callback.onStoppedUsingItem(Item.getIdFromItem(Minecraft.getHillePlayer().getItemInHand(Hand.MAIN_HAND)));
        }
        boolean sentPacket = false;
        if (Minecraft.getFrameWorld().isClient && !Minecraft.getHillePlayer().isOnGround() && !Minecraft.getHillePlayer().isTouchingWater()) {
            Minecraft.getNetworkHandler().sendPacket(new CPlayerPacket(Packets.PLAY_CLIENTbound.ON_USE_ENTITY, Minecraft.getHillePlayer().getId()));
            sentPacket = true;
        }
        long time = Minecraft.isOnServer ? System.currentTimeMillis() : System.currentTimeMillis() + 550;
        Callback.attackEntity(targetEntity, Minecraft.getHillePlayer());
        Minecraft.getHillePlayer().swingHand(Hand.MAIN_HAND);
        if (((Boolean)getSettingValue("break_shield")).booleanValue()) {
            this.breakShieldAndSwapSlot();
        }
        if (sentPacket) {
            Minecraft.getNetworkHandler().sendPacket(new CPlayerPacket(Packets.PLAY_CLIENTbound.ANIMATION, Minecraft.getHillePlayer().getId(), Minecraft.getHillePlayer().getMainArm().getId(), EnumHand.MAIN_HAND));
        }
    }

    public int breakShield(AttackSource source) {
    int axeSlot = inventory.getAxe(true);
    if (axeSlot != -1) {
        packetSender.sendPacket(new UseItemPacket(axeSlot));
        attackSource.attackEntity(getTarget(), sourceType);
        armSwing.swingArm();
        packetSender.sendPacket(new UseItemPacket(useItem(getOffhandSlot(isEating()))));
        return axeSlot;
    }
    axeSlot = inventory.getAxe(false);
    if (axeSlot != -1) {
        itemInteracter.pickItem(axeSlot);
        attackSource.attackEntity(getTarget(), sourceType);
        armSwing.swingArm();
        return axeSlot;
    }
    return -1;
}
    private void handleMotionEvent(MotionEvent event) {
    if (event == null || Main.getInst().getFunctionRegistry().getAutoPotion().isActive()) {
        return;
    }
    event.setYaw(getYaw(event.getPointerId(0)));
    event.setPitch(getPitch(event.getPointerId(1)));
    Aura.setX(getX(Aura.getPointerId(0)), getX(Aura.getPointerId(1)));
    Aura.setY(getY(Aura.getPointerId(0)), getY(Aura.getPointerId(1)));
    Aura.setPressure(getPressure(Aura.getPointerId(0)), getPressure(Aura.getPointerId(1)));
}
public static float rotate(float current, float target, float min, float max) {
    float delta = Math.copySign(Math.min(0.6f, Math.abs(target - current)), target - current);
    delta = Math.min(delta, Math.abs(min)) * Math.signum(min);
    delta = Math.min(delta, Math.abs(max)) * Math.signum(max);
    if (Math.abs(delta) > Math.abs(target - current)) {
        return target;
    }
    return current + delta;
}
private void findTarget() {
    List<Entity> entities = new ArrayList<>();
    for (Entity entity : getSortedTargets()) {
        if (!(entity instanceof LivingEntity) || !isValidTarget((LivingEntity) entity)) continue;
        entities.add(entity);
    }
    if (entities.isEmpty()) {
        setTarget(null);
        return;
    }
    if (entities.size() == 1) {
        setTarget((LivingEntity) entities.get(0));
        return;
    }
    entities.sort(Comparator.comparingDouble(entity -> {
        if (entity instanceof Player) {
            Player player = (Player) entity;
            return -getEntityArmor(player);
        }
        if (entity instanceof LivingEntity) {
            LivingEntity livingEntity = (LivingEntity) entity;
            return -livingEntity.getTotalArmorValue();
        }
        return 0.0;
    }).thenComparing((entity, entity2) -> {
        double health1 = getEntityHealth(entity);
        double health2 = getEntityHealth(entity2);
        return Double.compare(health1, health2);
    }).thenComparing((entity, entity2) -> {
        double distance1 = getEntityDistance(entity);
        double distance2 = getEntityDistance(entity2);
        return Double.compare(distance1, distance2);
    }));
    setTarget((LivingEntity) entities.get(0));
}
@Subscribe
private void onUpdate(UpdateEvent event) {
    if (getCurrentTarget() != null) {
        updateRotation();
        setTargetRotation(new Vector3f(wrapDegrees(getYaw() + 25.0f), getPitch(), 0.0f), 40.0f);
    }
    if (getTarget() == null || !isValidTarget(getTarget())) {
        findTarget();
    }
    if (getAttackTimer() == null) {
        setAttackTimer(this, System.currentTimeMillis());
        setTargetRotation(new Vector3f(smoothStep(getYaw(), getTargetYaw(), getSmoothness()), getSmoothStep(getPitch(), getTargetPitch()), 0.0f), Aura.getSmoothness());
        return;
    }
    attackAndRotateOnEntity(getTarget());
}
private boolean canSeeThroughWall(Entity entity) {
    return getPlayer().canEntityBeSeen(entity);
}

@Subscribe
public void onInput(InputEvent event) {
    if (getSetting(this).getValueByName("enable").getAsBoolean() && getPlayer().getInputManager().getIndex() == 0 && !isInWater()) {
        getJump().fixMovement(event, getPlayerController());
    }
}
public Aura() {
    this.settings = new ModeListSetting("Rotations", new BooleanSetting("Strafe", true), new BooleanSetting("Reverse", true), new BooleanSetting("Shield", true), new BooleanSetting("Abilities", true), new BooleanSetting("Potions", true), new BooleanSetting("Enchant", true));
    this.distance = new SliderSetting("Distance", 3.0f, 2.5f, 6.0f, 0.1f);
    this.rotateDistance = new SliderSetting("Rotate Distance", 1.5f, 0.0f, 3.0f, 0.1f);
    this.elytrarotate = new SliderSetting("Elytra Rotate", 1.0f, 0.0f, 30.0f, 0.05f);
    this.onlySpaceCritical = new BooleanSetting("Space Criticals", false).setVisible(() -> getSetting(this).getValueByName("Strafe").getAsBoolean());
    this.correctionType = new ModeSetting("Correction", "None", "Simple", "Smart", "Packet").setVisible(() -> getSetting(this).getValueByName("Shield").getAsBoolean());
    this.smartCorrection = new BooleanSetting("Smart Correction", false).setVisible(() -> getModeListSetting(this).is("Packet"));
    this.predictCritical = new BooleanSetting("Predict Criticals", true);
    this.stopWatch = new TimerUtil();
    this.addSettings(this.rotationMode, this.targets, this.sortMode, this.distance, this.rotateDistance, this.elytrarotate, this.settings, this.correctionType, this.onlySpaceCritical, this.smartCorrection, this.predictCritical);
}
public boolean canAttack() {
    boolean isOnGround = getPlayerController().isOnGround();
    boolean isMeleeKeyDown = getInputManager().isKeyDown();
    boolean isBow = isMeleeKeyDown && getSetting(this).get() && !getCriticalManager().isState();
    boolean isPotions = getPotionManager().isPotionActive(getPotionManager().getSpeed()) || getPotionManager().isPotionActive(getPotionManager().getStrength()) && getPlayerController().getCooledAttackStrength(1.5f) > 0.0f;
    boolean isOther = isOnLadder() || isInWater() && areEyesInFluid(isUnderwaterVision()) || isRidingHorse() || isInWeb() || isElytraFlying() || isInLava() && areEyesInFluid(isUnderlavaVision());
    if (getEntityDistance(getTarget()) <= (double)getSetting(this).get() && (isSwimming() ? getPlayerController().getCooledAttackStrength(1.5f) == 1.0f : getPlayerController().getCooledAttackStrength(1.5f) >= 0.93f)) {
        if (!isBow && getSettings(this).getValueByName("Shield").getAsBoolean()) {
            return isOnGround || !isState() && getSpeed() > 0.0f || isState() && !isBow();
        }
        return true;
    }
    return false;
}

@Subscribe
private void onRender(RenderEvent event) {
}
private void attackAndRotateOnEntity(LivingEntity livingEntity) {
    boolean isElytraFlying = getPlayerController().isElytraFlying();
    if (getPlayerController().getInputManager().getIndex() == 1 && !isElytraFlying) {
        if (shouldAttack(livingEntity)) {
            attackTarget(livingEntity);
            updateTimer(2.0f);
        }
        if (getAttackTimer() > 0.0f) {
            updateRotation(2.1474836E9f);
            setTargetRotation(getTargetRotation() - 1.0f);
        } else {
            resetRotation();
            setTargetRotation(getRotation() - 1.0f);
        }
    }
    if (getPlayerController().getInputManager().getIndex() == 0 || isElytraFlying) {
        if (shouldAttack(livingEntity)) {
            attackTarget(livingEntity);
        }
        if (!rayTraceSingleEntity(getRenderManager(), getEntity(livingEntity), getSetting(this).get(), livingEntity)) {
            updateRotation(9999.0f);
        }
    }
}
public void updateRotation() {
    if (!isRotationPaused(this)) {
        setTargetRotation(getTargetRotation() + 0.01f);
        if (getPitch(this) > 2.3) {
            setTargetRotation(2.3f);
            setRotationPaused(this, true);
        }
    } else {
        setTargetRotation(getTargetRotation() - 0.01f);
        if (getPitch(this) < -2.3) {
            setTargetRotation(-2.3f);
            setRotationPaused(this, false);
        }
    }
    setYaw(getYaw(this) + getRotationSpeed());
    setYaw(getWrappedYaw(this));
}
private void updateRotation(final float n) {
    if (shouldRotate(this)) {
        final Vector3d add = getPlayer().getPositionVec().add(0.0, Math.clamp(getRenderManager().getPosY() - getPlayer().getHeight(), 0.0, (double)(getPlayer().getHeight() / 2.0f)), 0.0).subtract(getRenderManager().getEyePosition(1.0f)).add(getPlayerController().getMotion().mul((getPlayerController().isElytraFlying() && getPlayerController().isElytraFlying()) ? 3.0 : 0.2, (getMainHandItem().isElytra() && getOffhandItem().isElytra()) ? 3.0 : 0.2, (getInventory().getArmorItem().isElytra() && getInventory().getArmorItem().isElytra()) ? 3.0 : 0.2));
        final float n2 = (float)wrapDegrees(Math.toDegrees(Math.atan2(add.x, add.z)) - 90.0);
        final float n3 = (float)(-Math.toDegrees(Math.atan2(add.x, Math.hypot(add.z, add.y))));
        final float wrapDegrees = wrapDegrees(n2 - getYaw());
        final float wrapDegrees2 = wrapDegrees(n3 - getPitch());
        final int n4 = (int)wrapDegrees;
        final String s = getModeListSetting(this).get();
        int n5 = -1;
        switch (s.hashCode()) {
            case 1337024415: {
                if (s.equals("Packet")) {
                    n5 = 0;
                    break;
                }
                break;
            }
            case -812015109: {
                if (s.equals("None")) {
                    n5 = 1;
                    break;
                }
                break;
            }
        }
        switch (n5) {
            case 0: {
                final float min = Math.min(Math.max(Math.abs(wrapDegrees), 1.0f), n);
                final float max = Math.max(Math.abs(wrapDegrees2), 1.0f);
                final float n6 = getRotationSpeed() + ((wrapDegrees > 0.0f) ? min : (-min)) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
                final float n7 = Math.clamp(getRotation() + ((wrapDegrees2 > 0.0f) ? max : (-max)), -89.0f, 89.0f) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
                setTargetRotation(new Vector3f(n6 - (n6 - getGCDValue()), n7 - (n7 - getGCDValue())));
                setMin(min);
                setMax(max);
                break;
            }
            case 1: {
                final float n8 = getYaw() + n4;
                final float clamp = Math.clamp(getPitch() + wrapDegrees2, -90.0f, 90.0f);
                final float gcdValue = getGCDValue();
                setTargetRotation(new Vector3f(n8 - (n8 - getGCDValue()), clamp - (clamp - getGCDValue())));
                break;
            }
        }
    }
    else {
    final Vector3d subtract = getPlayer().getPositionVec().add(0.0, Math.clamp(getRenderManager().getPosY() - getPlayer().getHeight(), 0.0, (double)(getPlayer().getHeight() / 2.0f)), 0.0).subtract(getRenderManager().getEyePosition(1.0f));
    final float n9 = (float)wrapDegrees(Math.toDegrees(Math.atan2(subtract.x, subtract.z)) - 90.0);
    final float n10 = (float)(-Math.toDegrees(Math.atan2(subtract.x, Math.hypot(subtract.z, subtract.y))));
    final float wrapDegrees3 = wrapDegrees(n9 - getYaw());
    final float wrapDegrees4 = wrapDegrees(n10 - getPitch());
    final int n11 = (int)wrapDegrees3;
    final String s2 = getModeListSetting(this).get();
    int n12 = -1;
    switch (s2.hashCode()) {
        case 1337024415: {
            if (s2.equals("Packet")) {
                n12 = 0;
                break;
            }
            break;
        }
        case -812015109: {
            if (s2.equals("None")) {
                n12 = 1;
                break;
            }
            break;
        }
    }
    switch (n12) {
        case 0: {
            final float min2 = Math.min(Math.max(Math.abs(wrapDegrees3), 1.0f), n);
            final float max2 = Math.max(Math.abs(wrapDegrees4), partum);
            final float n13 = getRotationSpeed() + ((wrapDegrees3 > 0.0f) ? min2 : (-min2)) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
            final float n14 = Math.clamp(getRotation() + ((wrapDegrees4 > 0.0f) ? max2 : (-max2)), -89.0f, 89.0f) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
            setTargetRotation(new Vector3f(n13 - (n13 - getGCDValue()), n14 - (n14 - getGCDValue())));
            setMin(min2);
            setMax(max2);
            break;
        }
        case 1: {
            final float n15 = getYaw() + n11;
            final float clamp2 = Math.clamp(getPitch() + wrapDegrees4, -90.0f, 90.0f);
            final float gcdValue2 = getGCDValue();
            setTargetRotation(new Vector3f(n15 - (n15 - getGCDValue()), clamp2 - (clamp2 - getGCDValue())));
            break;
        }
    }
}
}
public static Vector3d getVector(final Entity entity) {
    final double n = entity.getWidth() * entity.getWidth() * entity.getWidth() * entity.getWidth();
    return new Vector3d(entity.getPosX() - getPlayer().getPosX() + Math.clamp(getRenderManager().getPosX() - entity.getPosX(), -n, n), entity.getPosY() - getPlayer().getPosYEye() + Math.clamp(entity.getPosYEye() - entity.getPosY(), 0.0, entity.getHeight() / 1.7), entity.getPosZ() - getPlayer().getPosZ() + Math.clamp(getRenderManager().getPosZ() - entity.getPosZ(), -n, n));
}
@Subscribe
private void onVisualRotate(final RotationEvent event) {
    if (!(event.getEntity() instanceof Entity)) {
        return;
    }
    if (getAttackTimer() == null) {
        return;
    }
}
private /* synthetic */ double lambda$findTarget$3(final Object o) {
    if (o instanceof final Player player) {
        return -getEntityArmor(player);
    }
    if (o instanceof final LivingEntity livingEntity) {
        return -livingEntity.getTotalArmorValue();
    }
    return 0.0;
}
private void breakShieldAndSwapSlot() {
    final Entity entity = getTarget();
    if (entity instanceof final Player player) {
        if (getFunctionRegistry().getAutoPotion().isActive() && !player.isSpectator() && !player.isCreative() && (getInventory().getHeldItemOffhand().getItem() == getFunctionRegistry().getShield() || getInventory().getHeldItemMainhand().getItem() == getFunctionRegistry().getSword())) {
            final int breakShield = this.breakShield((LivingEntity) player);
            if (breakShield > 8) {
                getPlayerController().pickItem(breakShield);
            }
        }
    }
}
private double getDistance(final Entity entity) {
    return getVector(entity).length();
}

private double getProtectionLvl(final ItemStack itemStack) {
    double n = itemStack.getDamageReduceAmount();
    if (itemStack.isEnchanted()) {
        n += EnchantmentHelper.getEnchantmentLevel(getFunctionRegistry().getProtection(), itemStack) * 0.25;
    }
    return n;
}
private static void setRenderYawOffset(final Entity entity, final float renderYawOffset) {
    entity.renderYawOffset = renderYawOffset;
}
static {
    Aura.target = null;
    Aura.fakeRotateVector = new Vector3f(0.0f, 0.0f);
    Aura.fakePrevRotateVector = new Vector3f(0.0f, 0.0f);
    Aura.rotate = new Vector3f(0.0f, 0.0f);
}
public double getEntityArmor(final Player player) {
    double n = 0.0;
    for (final ItemStack itemStack : getPlayer().getArmorItems()) {
        if (itemStack != null && itemStack.getItem() instanceof ArmorItem) {
            n += this.getProtectionLvl(itemStack);
        }
    }
    return n;
}
@Override
public void onDisable() {
    setTargetRotation(new Vector3f(getRenderManager().getRenderYawOffset(getPlayer()), getRenderManager().getRenderPitchOffset(getPlayer())));
    setTarget(null);
    setAttackTimer(null);
    setAttackTimer(this, System.currentTimeMillis());
    super.onDisable();
}
public double getEntityHealth(final Entity entity) {
    if (entity instanceof final Player player) {
        return (player.getHealth() + player.getAbsorptionAmount()) * (this.getEntityArmor(player) / 20.0);
    }
    if (entity instanceof final LivingEntity livingEntity) {
        return livingEntity.getHealth() + livingEntity.getAbsorptionAmount();
    }
    return 0.0;
}
}
это килка с элитра таргета?
 
Начинающий
Статус
Оффлайн
Регистрация
30 Май 2024
Сообщения
106
Реакции[?]
1
Поинты[?]
1K
(помощник) кодера был слишком выёбчивым и тупым и я сливаю вам это горе пасто килку ,если хотите солью худ :da:

Код:
import net.minecraft.EnchantmentHelper;
import net.minecraft.Entity;
import net.minecraft.ItemStack;
import net.minecraft.Player;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.Mouse;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.Matrix4f;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.util.math.Vector3d;
import net.minecraft.client.util.math.Vector3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.goal.GoalSelector;
import net.minecraft.entity.ai.goal.MoveTowardsRestriction;
import net.minecraft.entity.ai.goal.MoveTowardsTarget;
import net.minecraft.entity.ai.goal.PrioritizedGoal;
import net.minecraft.entity.player.PlayerAbilities;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.PacketPlayInArmAnimation;
import net.minecraft.network.packet.c2s.PacketPlayInBlockPlace;
import net.minecraft.network.packet.c2s.PacketPlayInUseItem;
import net.minecraft.network.packet.c2s.PacketPlayInSteerVehicle;
import net.minecraft.network.packet.c2s.PacketPlayInWindowClick;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.RecipeType;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.TypedActionResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import ru.vorkis.Aura;
import ru.vorkis.AuraConfig;
import ru.vorkis.functions.settings.Setting;
import ru.vorkis.functions.settings.SettingsManager;
import ru.vorkis.functions.settings.impl.ModeListSetting;
import ru.vorkis.functions.settings.impl.BooleanSetting;
import ru.vorkis.functions.settings.impl.ModeSetting;
import ru.vorkis.functions.settings.impl.SliderSetting;
import ru.vorkis.functions.api.Category;
import ru.vorkis.functions.api.FunctionRegister;
import ru.vorkis.functions.api.Function;
import ru.vorkis.Main;
import ru.vorkis.utils.Timer;
import ru.vorkis.utils.TimerUtil;
import ru.vorkis.utils.TimerUtil.TimeType;
import ru.vorkis.utils.misc.MathUtils;
import ru.vorkis.utils.misc.TimerUtils;
import ru.vorkis.utils.PlayerUtils;
import ru.vorkis.utils.PlayerUtils.InputManager;
import ru.vorkis.utils.PlayerUtils.RenderManager;
import ru.vorkis.utils.events.AttackTimerEvent;
import ru.vorkis.utils.events.InputEvent;
import ru.vorkis.utils.events.RenderEvent;
import ru.vorkis.utils.events.UpdateEvent;
import ru.vorkis.utils.events.VisualRotateEvent;
import ru.vorkis.utils.events.WeaponSwapEvent;
import com.google.common.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import net.minecraft.client.render.Camera.CameraProjection;

@FunctionRegister(
    name = "Aura",
    type = Category.COMBAT
)
public class Aura extends Function {

public float rotationSpeed = 0.0f;
public SliderSetting rotateDistance;
public boolean isReversing = false;
public ModeSetting rotationMode = new ModeSetting(
    "forward",
    "back",
    "reverse",
    "strafe"
);
public SliderSetting elytrarotate;
public float lastYaw;
private final float maxRotationSpeed = 1.5f;
public BooleanSetting smartCorrection;
private final float acceleration = 0.01f;
public float rotationAngle = 0.0f;
public SliderSetting distance;
public ModeListSetting settings;
private ModeSetting sortMode = new ModeSetting(
    "Normal",
    "Top",
    "Bottom",
    "Top",
    "Bottom"
);
private long cpsLimit = 0L;
private TimerUtil stopWatch;
private Vector3f fakePrevRotateVector;
private Vector3f fakeRotateVector;
private boolean hasRotated;
public Entity target;
public float ticksUntilNextAttack;
public BooleanSetting onlySpaceCritical;
public BooleanSetting predictCritical;
public ModeListSetting targets = new ModeListSetting(
    "Closest",
    new BooleanSetting("No_Shield", true),
    new BooleanSetting("No_Abilities", false),
    new BooleanSetting("No_Potions", true),
    new BooleanSetting("No_Enchant", false),
    new BooleanSetting("No_Projectiles", false)
);
public ModeSetting correctionType;
public float lastPitch;
public Vector3f rotate;

   static float getYaw(Entity entity) {
    return entity.rotationYaw;
}

    private void attackTarget(Entity targetEntity) {
        if (((Boolean)getSettingValue("critical_anti_cooldown")).booleanValue() && MinecraftServer.getServer().playerInteractionManager.isBlocking(Minecraft.get HillePlayer())) {
            Callback.onStoppedUsingItem(Item.getIdFromItem(Minecraft.getHillePlayer().getItemInHand(Hand.MAIN_HAND)));
        }
        boolean sentPacket = false;
        if (Minecraft.getFrameWorld().isClient && !Minecraft.getHillePlayer().isOnGround() && !Minecraft.getHillePlayer().isTouchingWater()) {
            Minecraft.getNetworkHandler().sendPacket(new CPlayerPacket(Packets.PLAY_CLIENTbound.ON_USE_ENTITY, Minecraft.getHillePlayer().getId()));
            sentPacket = true;
        }
        long time = Minecraft.isOnServer ? System.currentTimeMillis() : System.currentTimeMillis() + 550;
        Callback.attackEntity(targetEntity, Minecraft.getHillePlayer());
        Minecraft.getHillePlayer().swingHand(Hand.MAIN_HAND);
        if (((Boolean)getSettingValue("break_shield")).booleanValue()) {
            this.breakShieldAndSwapSlot();
        }
        if (sentPacket) {
            Minecraft.getNetworkHandler().sendPacket(new CPlayerPacket(Packets.PLAY_CLIENTbound.ANIMATION, Minecraft.getHillePlayer().getId(), Minecraft.getHillePlayer().getMainArm().getId(), EnumHand.MAIN_HAND));
        }
    }

    public int breakShield(AttackSource source) {
    int axeSlot = inventory.getAxe(true);
    if (axeSlot != -1) {
        packetSender.sendPacket(new UseItemPacket(axeSlot));
        attackSource.attackEntity(getTarget(), sourceType);
        armSwing.swingArm();
        packetSender.sendPacket(new UseItemPacket(useItem(getOffhandSlot(isEating()))));
        return axeSlot;
    }
    axeSlot = inventory.getAxe(false);
    if (axeSlot != -1) {
        itemInteracter.pickItem(axeSlot);
        attackSource.attackEntity(getTarget(), sourceType);
        armSwing.swingArm();
        return axeSlot;
    }
    return -1;
}
    private void handleMotionEvent(MotionEvent event) {
    if (event == null || Main.getInst().getFunctionRegistry().getAutoPotion().isActive()) {
        return;
    }
    event.setYaw(getYaw(event.getPointerId(0)));
    event.setPitch(getPitch(event.getPointerId(1)));
    Aura.setX(getX(Aura.getPointerId(0)), getX(Aura.getPointerId(1)));
    Aura.setY(getY(Aura.getPointerId(0)), getY(Aura.getPointerId(1)));
    Aura.setPressure(getPressure(Aura.getPointerId(0)), getPressure(Aura.getPointerId(1)));
}
public static float rotate(float current, float target, float min, float max) {
    float delta = Math.copySign(Math.min(0.6f, Math.abs(target - current)), target - current);
    delta = Math.min(delta, Math.abs(min)) * Math.signum(min);
    delta = Math.min(delta, Math.abs(max)) * Math.signum(max);
    if (Math.abs(delta) > Math.abs(target - current)) {
        return target;
    }
    return current + delta;
}
private void findTarget() {
    List<Entity> entities = new ArrayList<>();
    for (Entity entity : getSortedTargets()) {
        if (!(entity instanceof LivingEntity) || !isValidTarget((LivingEntity) entity)) continue;
        entities.add(entity);
    }
    if (entities.isEmpty()) {
        setTarget(null);
        return;
    }
    if (entities.size() == 1) {
        setTarget((LivingEntity) entities.get(0));
        return;
    }
    entities.sort(Comparator.comparingDouble(entity -> {
        if (entity instanceof Player) {
            Player player = (Player) entity;
            return -getEntityArmor(player);
        }
        if (entity instanceof LivingEntity) {
            LivingEntity livingEntity = (LivingEntity) entity;
            return -livingEntity.getTotalArmorValue();
        }
        return 0.0;
    }).thenComparing((entity, entity2) -> {
        double health1 = getEntityHealth(entity);
        double health2 = getEntityHealth(entity2);
        return Double.compare(health1, health2);
    }).thenComparing((entity, entity2) -> {
        double distance1 = getEntityDistance(entity);
        double distance2 = getEntityDistance(entity2);
        return Double.compare(distance1, distance2);
    }));
    setTarget((LivingEntity) entities.get(0));
}
@Subscribe
private void onUpdate(UpdateEvent event) {
    if (getCurrentTarget() != null) {
        updateRotation();
        setTargetRotation(new Vector3f(wrapDegrees(getYaw() + 25.0f), getPitch(), 0.0f), 40.0f);
    }
    if (getTarget() == null || !isValidTarget(getTarget())) {
        findTarget();
    }
    if (getAttackTimer() == null) {
        setAttackTimer(this, System.currentTimeMillis());
        setTargetRotation(new Vector3f(smoothStep(getYaw(), getTargetYaw(), getSmoothness()), getSmoothStep(getPitch(), getTargetPitch()), 0.0f), Aura.getSmoothness());
        return;
    }
    attackAndRotateOnEntity(getTarget());
}
private boolean canSeeThroughWall(Entity entity) {
    return getPlayer().canEntityBeSeen(entity);
}

@Subscribe
public void onInput(InputEvent event) {
    if (getSetting(this).getValueByName("enable").getAsBoolean() && getPlayer().getInputManager().getIndex() == 0 && !isInWater()) {
        getJump().fixMovement(event, getPlayerController());
    }
}
public Aura() {
    this.settings = new ModeListSetting("Rotations", new BooleanSetting("Strafe", true), new BooleanSetting("Reverse", true), new BooleanSetting("Shield", true), new BooleanSetting("Abilities", true), new BooleanSetting("Potions", true), new BooleanSetting("Enchant", true));
    this.distance = new SliderSetting("Distance", 3.0f, 2.5f, 6.0f, 0.1f);
    this.rotateDistance = new SliderSetting("Rotate Distance", 1.5f, 0.0f, 3.0f, 0.1f);
    this.elytrarotate = new SliderSetting("Elytra Rotate", 1.0f, 0.0f, 30.0f, 0.05f);
    this.onlySpaceCritical = new BooleanSetting("Space Criticals", false).setVisible(() -> getSetting(this).getValueByName("Strafe").getAsBoolean());
    this.correctionType = new ModeSetting("Correction", "None", "Simple", "Smart", "Packet").setVisible(() -> getSetting(this).getValueByName("Shield").getAsBoolean());
    this.smartCorrection = new BooleanSetting("Smart Correction", false).setVisible(() -> getModeListSetting(this).is("Packet"));
    this.predictCritical = new BooleanSetting("Predict Criticals", true);
    this.stopWatch = new TimerUtil();
    this.addSettings(this.rotationMode, this.targets, this.sortMode, this.distance, this.rotateDistance, this.elytrarotate, this.settings, this.correctionType, this.onlySpaceCritical, this.smartCorrection, this.predictCritical);
}
public boolean canAttack() {
    boolean isOnGround = getPlayerController().isOnGround();
    boolean isMeleeKeyDown = getInputManager().isKeyDown();
    boolean isBow = isMeleeKeyDown && getSetting(this).get() && !getCriticalManager().isState();
    boolean isPotions = getPotionManager().isPotionActive(getPotionManager().getSpeed()) || getPotionManager().isPotionActive(getPotionManager().getStrength()) && getPlayerController().getCooledAttackStrength(1.5f) > 0.0f;
    boolean isOther = isOnLadder() || isInWater() && areEyesInFluid(isUnderwaterVision()) || isRidingHorse() || isInWeb() || isElytraFlying() || isInLava() && areEyesInFluid(isUnderlavaVision());
    if (getEntityDistance(getTarget()) <= (double)getSetting(this).get() && (isSwimming() ? getPlayerController().getCooledAttackStrength(1.5f) == 1.0f : getPlayerController().getCooledAttackStrength(1.5f) >= 0.93f)) {
        if (!isBow && getSettings(this).getValueByName("Shield").getAsBoolean()) {
            return isOnGround || !isState() && getSpeed() > 0.0f || isState() && !isBow();
        }
        return true;
    }
    return false;
}

@Subscribe
private void onRender(RenderEvent event) {
}
private void attackAndRotateOnEntity(LivingEntity livingEntity) {
    boolean isElytraFlying = getPlayerController().isElytraFlying();
    if (getPlayerController().getInputManager().getIndex() == 1 && !isElytraFlying) {
        if (shouldAttack(livingEntity)) {
            attackTarget(livingEntity);
            updateTimer(2.0f);
        }
        if (getAttackTimer() > 0.0f) {
            updateRotation(2.1474836E9f);
            setTargetRotation(getTargetRotation() - 1.0f);
        } else {
            resetRotation();
            setTargetRotation(getRotation() - 1.0f);
        }
    }
    if (getPlayerController().getInputManager().getIndex() == 0 || isElytraFlying) {
        if (shouldAttack(livingEntity)) {
            attackTarget(livingEntity);
        }
        if (!rayTraceSingleEntity(getRenderManager(), getEntity(livingEntity), getSetting(this).get(), livingEntity)) {
            updateRotation(9999.0f);
        }
    }
}
public void updateRotation() {
    if (!isRotationPaused(this)) {
        setTargetRotation(getTargetRotation() + 0.01f);
        if (getPitch(this) > 2.3) {
            setTargetRotation(2.3f);
            setRotationPaused(this, true);
        }
    } else {
        setTargetRotation(getTargetRotation() - 0.01f);
        if (getPitch(this) < -2.3) {
            setTargetRotation(-2.3f);
            setRotationPaused(this, false);
        }
    }
    setYaw(getYaw(this) + getRotationSpeed());
    setYaw(getWrappedYaw(this));
}
private void updateRotation(final float n) {
    if (shouldRotate(this)) {
        final Vector3d add = getPlayer().getPositionVec().add(0.0, Math.clamp(getRenderManager().getPosY() - getPlayer().getHeight(), 0.0, (double)(getPlayer().getHeight() / 2.0f)), 0.0).subtract(getRenderManager().getEyePosition(1.0f)).add(getPlayerController().getMotion().mul((getPlayerController().isElytraFlying() && getPlayerController().isElytraFlying()) ? 3.0 : 0.2, (getMainHandItem().isElytra() && getOffhandItem().isElytra()) ? 3.0 : 0.2, (getInventory().getArmorItem().isElytra() && getInventory().getArmorItem().isElytra()) ? 3.0 : 0.2));
        final float n2 = (float)wrapDegrees(Math.toDegrees(Math.atan2(add.x, add.z)) - 90.0);
        final float n3 = (float)(-Math.toDegrees(Math.atan2(add.x, Math.hypot(add.z, add.y))));
        final float wrapDegrees = wrapDegrees(n2 - getYaw());
        final float wrapDegrees2 = wrapDegrees(n3 - getPitch());
        final int n4 = (int)wrapDegrees;
        final String s = getModeListSetting(this).get();
        int n5 = -1;
        switch (s.hashCode()) {
            case 1337024415: {
                if (s.equals("Packet")) {
                    n5 = 0;
                    break;
                }
                break;
            }
            case -812015109: {
                if (s.equals("None")) {
                    n5 = 1;
                    break;
                }
                break;
            }
        }
        switch (n5) {
            case 0: {
                final float min = Math.min(Math.max(Math.abs(wrapDegrees), 1.0f), n);
                final float max = Math.max(Math.abs(wrapDegrees2), 1.0f);
                final float n6 = getRotationSpeed() + ((wrapDegrees > 0.0f) ? min : (-min)) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
                final float n7 = Math.clamp(getRotation() + ((wrapDegrees2 > 0.0f) ? max : (-max)), -89.0f, 89.0f) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
                setTargetRotation(new Vector3f(n6 - (n6 - getGCDValue()), n7 - (n7 - getGCDValue())));
                setMin(min);
                setMax(max);
                break;
            }
            case 1: {
                final float n8 = getYaw() + n4;
                final float clamp = Math.clamp(getPitch() + wrapDegrees2, -90.0f, 90.0f);
                final float gcdValue = getGCDValue();
                setTargetRotation(new Vector3f(n8 - (n8 - getGCDValue()), clamp - (clamp - getGCDValue())));
                break;
            }
        }
    }
    else {
    final Vector3d subtract = getPlayer().getPositionVec().add(0.0, Math.clamp(getRenderManager().getPosY() - getPlayer().getHeight(), 0.0, (double)(getPlayer().getHeight() / 2.0f)), 0.0).subtract(getRenderManager().getEyePosition(1.0f));
    final float n9 = (float)wrapDegrees(Math.toDegrees(Math.atan2(subtract.x, subtract.z)) - 90.0);
    final float n10 = (float)(-Math.toDegrees(Math.atan2(subtract.x, Math.hypot(subtract.z, subtract.y))));
    final float wrapDegrees3 = wrapDegrees(n9 - getYaw());
    final float wrapDegrees4 = wrapDegrees(n10 - getPitch());
    final int n11 = (int)wrapDegrees3;
    final String s2 = getModeListSetting(this).get();
    int n12 = -1;
    switch (s2.hashCode()) {
        case 1337024415: {
            if (s2.equals("Packet")) {
                n12 = 0;
                break;
            }
            break;
        }
        case -812015109: {
            if (s2.equals("None")) {
                n12 = 1;
                break;
            }
            break;
        }
    }
    switch (n12) {
        case 0: {
            final float min2 = Math.min(Math.max(Math.abs(wrapDegrees3), 1.0f), n);
            final float max2 = Math.max(Math.abs(wrapDegrees4), partum);
            final float n13 = getRotationSpeed() + ((wrapDegrees3 > 0.0f) ? min2 : (-min2)) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
            final float n14 = Math.clamp(getRotation() + ((wrapDegrees4 > 0.0f) ? max2 : (-max2)), -89.0f, 89.0f) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
            setTargetRotation(new Vector3f(n13 - (n13 - getGCDValue()), n14 - (n14 - getGCDValue())));
            setMin(min2);
            setMax(max2);
            break;
        }
        case 1: {
            final float n15 = getYaw() + n11;
            final float clamp2 = Math.clamp(getPitch() + wrapDegrees4, -90.0f, 90.0f);
            final float gcdValue2 = getGCDValue();
            setTargetRotation(new Vector3f(n15 - (n15 - getGCDValue()), clamp2 - (clamp2 - getGCDValue())));
            break;
        }
    }
}
}
public static Vector3d getVector(final Entity entity) {
    final double n = entity.getWidth() * entity.getWidth() * entity.getWidth() * entity.getWidth();
    return new Vector3d(entity.getPosX() - getPlayer().getPosX() + Math.clamp(getRenderManager().getPosX() - entity.getPosX(), -n, n), entity.getPosY() - getPlayer().getPosYEye() + Math.clamp(entity.getPosYEye() - entity.getPosY(), 0.0, entity.getHeight() / 1.7), entity.getPosZ() - getPlayer().getPosZ() + Math.clamp(getRenderManager().getPosZ() - entity.getPosZ(), -n, n));
}
@Subscribe
private void onVisualRotate(final RotationEvent event) {
    if (!(event.getEntity() instanceof Entity)) {
        return;
    }
    if (getAttackTimer() == null) {
        return;
    }
}
private /* synthetic */ double lambda$findTarget$3(final Object o) {
    if (o instanceof final Player player) {
        return -getEntityArmor(player);
    }
    if (o instanceof final LivingEntity livingEntity) {
        return -livingEntity.getTotalArmorValue();
    }
    return 0.0;
}
private void breakShieldAndSwapSlot() {
    final Entity entity = getTarget();
    if (entity instanceof final Player player) {
        if (getFunctionRegistry().getAutoPotion().isActive() && !player.isSpectator() && !player.isCreative() && (getInventory().getHeldItemOffhand().getItem() == getFunctionRegistry().getShield() || getInventory().getHeldItemMainhand().getItem() == getFunctionRegistry().getSword())) {
            final int breakShield = this.breakShield((LivingEntity) player);
            if (breakShield > 8) {
                getPlayerController().pickItem(breakShield);
            }
        }
    }
}
private double getDistance(final Entity entity) {
    return getVector(entity).length();
}

private double getProtectionLvl(final ItemStack itemStack) {
    double n = itemStack.getDamageReduceAmount();
    if (itemStack.isEnchanted()) {
        n += EnchantmentHelper.getEnchantmentLevel(getFunctionRegistry().getProtection(), itemStack) * 0.25;
    }
    return n;
}
private static void setRenderYawOffset(final Entity entity, final float renderYawOffset) {
    entity.renderYawOffset = renderYawOffset;
}
static {
    Aura.target = null;
    Aura.fakeRotateVector = new Vector3f(0.0f, 0.0f);
    Aura.fakePrevRotateVector = new Vector3f(0.0f, 0.0f);
    Aura.rotate = new Vector3f(0.0f, 0.0f);
}
public double getEntityArmor(final Player player) {
    double n = 0.0;
    for (final ItemStack itemStack : getPlayer().getArmorItems()) {
        if (itemStack != null && itemStack.getItem() instanceof ArmorItem) {
            n += this.getProtectionLvl(itemStack);
        }
    }
    return n;
}
@Override
public void onDisable() {
    setTargetRotation(new Vector3f(getRenderManager().getRenderYawOffset(getPlayer()), getRenderManager().getRenderPitchOffset(getPlayer())));
    setTarget(null);
    setAttackTimer(null);
    setAttackTimer(this, System.currentTimeMillis());
    super.onDisable();
}
public double getEntityHealth(final Entity entity) {
    if (entity instanceof final Player player) {
        return (player.getHealth() + player.getAbsorptionAmount()) * (this.getEntityArmor(player) / 20.0);
    }
    if (entity instanceof final LivingEntity livingEntity) {
        return livingEntity.getHealth() + livingEntity.getAbsorptionAmount();
    }
    return 0.0;
}
}
жалко без ускорения(
 
Начинающий
Статус
Онлайн
Регистрация
20 Авг 2024
Сообщения
67
Реакции[?]
0
Поинты[?]
0
+REP что сказать красавчик +уважение +сигмафейс +югейм любимчик ВОРКИС ПРОСТО НЕМНОГО ДАУН :CoolCat:
 
Забаненный
Статус
Оффлайн
Регистрация
27 Май 2024
Сообщения
265
Реакции[?]
10
Поинты[?]
10K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
(помощник) кодера был слишком выёбчивым и тупым и я сливаю вам это горе пасто килку ,если хотите солью худ :da:

Код:
import net.minecraft.EnchantmentHelper;
import net.minecraft.Entity;
import net.minecraft.ItemStack;
import net.minecraft.Player;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.Mouse;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.Matrix4f;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.util.math.Vector3d;
import net.minecraft.client.util.math.Vector3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.goal.GoalSelector;
import net.minecraft.entity.ai.goal.MoveTowardsRestriction;
import net.minecraft.entity.ai.goal.MoveTowardsTarget;
import net.minecraft.entity.ai.goal.PrioritizedGoal;
import net.minecraft.entity.player.PlayerAbilities;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.PacketPlayInArmAnimation;
import net.minecraft.network.packet.c2s.PacketPlayInBlockPlace;
import net.minecraft.network.packet.c2s.PacketPlayInUseItem;
import net.minecraft.network.packet.c2s.PacketPlayInSteerVehicle;
import net.minecraft.network.packet.c2s.PacketPlayInWindowClick;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.RecipeType;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.TypedActionResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import ru.vorkis.Aura;
import ru.vorkis.AuraConfig;
import ru.vorkis.functions.settings.Setting;
import ru.vorkis.functions.settings.SettingsManager;
import ru.vorkis.functions.settings.impl.ModeListSetting;
import ru.vorkis.functions.settings.impl.BooleanSetting;
import ru.vorkis.functions.settings.impl.ModeSetting;
import ru.vorkis.functions.settings.impl.SliderSetting;
import ru.vorkis.functions.api.Category;
import ru.vorkis.functions.api.FunctionRegister;
import ru.vorkis.functions.api.Function;
import ru.vorkis.Main;
import ru.vorkis.utils.Timer;
import ru.vorkis.utils.TimerUtil;
import ru.vorkis.utils.TimerUtil.TimeType;
import ru.vorkis.utils.misc.MathUtils;
import ru.vorkis.utils.misc.TimerUtils;
import ru.vorkis.utils.PlayerUtils;
import ru.vorkis.utils.PlayerUtils.InputManager;
import ru.vorkis.utils.PlayerUtils.RenderManager;
import ru.vorkis.utils.events.AttackTimerEvent;
import ru.vorkis.utils.events.InputEvent;
import ru.vorkis.utils.events.RenderEvent;
import ru.vorkis.utils.events.UpdateEvent;
import ru.vorkis.utils.events.VisualRotateEvent;
import ru.vorkis.utils.events.WeaponSwapEvent;
import com.google.common.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import net.minecraft.client.render.Camera.CameraProjection;

@FunctionRegister(
    name = "Aura",
    type = Category.COMBAT
)
public class Aura extends Function {

public float rotationSpeed = 0.0f;
public SliderSetting rotateDistance;
public boolean isReversing = false;
public ModeSetting rotationMode = new ModeSetting(
    "forward",
    "back",
    "reverse",
    "strafe"
);
public SliderSetting elytrarotate;
public float lastYaw;
private final float maxRotationSpeed = 1.5f;
public BooleanSetting smartCorrection;
private final float acceleration = 0.01f;
public float rotationAngle = 0.0f;
public SliderSetting distance;
public ModeListSetting settings;
private ModeSetting sortMode = new ModeSetting(
    "Normal",
    "Top",
    "Bottom",
    "Top",
    "Bottom"
);
private long cpsLimit = 0L;
private TimerUtil stopWatch;
private Vector3f fakePrevRotateVector;
private Vector3f fakeRotateVector;
private boolean hasRotated;
public Entity target;
public float ticksUntilNextAttack;
public BooleanSetting onlySpaceCritical;
public BooleanSetting predictCritical;
public ModeListSetting targets = new ModeListSetting(
    "Closest",
    new BooleanSetting("No_Shield", true),
    new BooleanSetting("No_Abilities", false),
    new BooleanSetting("No_Potions", true),
    new BooleanSetting("No_Enchant", false),
    new BooleanSetting("No_Projectiles", false)
);
public ModeSetting correctionType;
public float lastPitch;
public Vector3f rotate;

   static float getYaw(Entity entity) {
    return entity.rotationYaw;
}

    private void attackTarget(Entity targetEntity) {
        if (((Boolean)getSettingValue("critical_anti_cooldown")).booleanValue() && MinecraftServer.getServer().playerInteractionManager.isBlocking(Minecraft.get HillePlayer())) {
            Callback.onStoppedUsingItem(Item.getIdFromItem(Minecraft.getHillePlayer().getItemInHand(Hand.MAIN_HAND)));
        }
        boolean sentPacket = false;
        if (Minecraft.getFrameWorld().isClient && !Minecraft.getHillePlayer().isOnGround() && !Minecraft.getHillePlayer().isTouchingWater()) {
            Minecraft.getNetworkHandler().sendPacket(new CPlayerPacket(Packets.PLAY_CLIENTbound.ON_USE_ENTITY, Minecraft.getHillePlayer().getId()));
            sentPacket = true;
        }
        long time = Minecraft.isOnServer ? System.currentTimeMillis() : System.currentTimeMillis() + 550;
        Callback.attackEntity(targetEntity, Minecraft.getHillePlayer());
        Minecraft.getHillePlayer().swingHand(Hand.MAIN_HAND);
        if (((Boolean)getSettingValue("break_shield")).booleanValue()) {
            this.breakShieldAndSwapSlot();
        }
        if (sentPacket) {
            Minecraft.getNetworkHandler().sendPacket(new CPlayerPacket(Packets.PLAY_CLIENTbound.ANIMATION, Minecraft.getHillePlayer().getId(), Minecraft.getHillePlayer().getMainArm().getId(), EnumHand.MAIN_HAND));
        }
    }

    public int breakShield(AttackSource source) {
    int axeSlot = inventory.getAxe(true);
    if (axeSlot != -1) {
        packetSender.sendPacket(new UseItemPacket(axeSlot));
        attackSource.attackEntity(getTarget(), sourceType);
        armSwing.swingArm();
        packetSender.sendPacket(new UseItemPacket(useItem(getOffhandSlot(isEating()))));
        return axeSlot;
    }
    axeSlot = inventory.getAxe(false);
    if (axeSlot != -1) {
        itemInteracter.pickItem(axeSlot);
        attackSource.attackEntity(getTarget(), sourceType);
        armSwing.swingArm();
        return axeSlot;
    }
    return -1;
}
    private void handleMotionEvent(MotionEvent event) {
    if (event == null || Main.getInst().getFunctionRegistry().getAutoPotion().isActive()) {
        return;
    }
    event.setYaw(getYaw(event.getPointerId(0)));
    event.setPitch(getPitch(event.getPointerId(1)));
    Aura.setX(getX(Aura.getPointerId(0)), getX(Aura.getPointerId(1)));
    Aura.setY(getY(Aura.getPointerId(0)), getY(Aura.getPointerId(1)));
    Aura.setPressure(getPressure(Aura.getPointerId(0)), getPressure(Aura.getPointerId(1)));
}
public static float rotate(float current, float target, float min, float max) {
    float delta = Math.copySign(Math.min(0.6f, Math.abs(target - current)), target - current);
    delta = Math.min(delta, Math.abs(min)) * Math.signum(min);
    delta = Math.min(delta, Math.abs(max)) * Math.signum(max);
    if (Math.abs(delta) > Math.abs(target - current)) {
        return target;
    }
    return current + delta;
}
private void findTarget() {
    List<Entity> entities = new ArrayList<>();
    for (Entity entity : getSortedTargets()) {
        if (!(entity instanceof LivingEntity) || !isValidTarget((LivingEntity) entity)) continue;
        entities.add(entity);
    }
    if (entities.isEmpty()) {
        setTarget(null);
        return;
    }
    if (entities.size() == 1) {
        setTarget((LivingEntity) entities.get(0));
        return;
    }
    entities.sort(Comparator.comparingDouble(entity -> {
        if (entity instanceof Player) {
            Player player = (Player) entity;
            return -getEntityArmor(player);
        }
        if (entity instanceof LivingEntity) {
            LivingEntity livingEntity = (LivingEntity) entity;
            return -livingEntity.getTotalArmorValue();
        }
        return 0.0;
    }).thenComparing((entity, entity2) -> {
        double health1 = getEntityHealth(entity);
        double health2 = getEntityHealth(entity2);
        return Double.compare(health1, health2);
    }).thenComparing((entity, entity2) -> {
        double distance1 = getEntityDistance(entity);
        double distance2 = getEntityDistance(entity2);
        return Double.compare(distance1, distance2);
    }));
    setTarget((LivingEntity) entities.get(0));
}
@Subscribe
private void onUpdate(UpdateEvent event) {
    if (getCurrentTarget() != null) {
        updateRotation();
        setTargetRotation(new Vector3f(wrapDegrees(getYaw() + 25.0f), getPitch(), 0.0f), 40.0f);
    }
    if (getTarget() == null || !isValidTarget(getTarget())) {
        findTarget();
    }
    if (getAttackTimer() == null) {
        setAttackTimer(this, System.currentTimeMillis());
        setTargetRotation(new Vector3f(smoothStep(getYaw(), getTargetYaw(), getSmoothness()), getSmoothStep(getPitch(), getTargetPitch()), 0.0f), Aura.getSmoothness());
        return;
    }
    attackAndRotateOnEntity(getTarget());
}
private boolean canSeeThroughWall(Entity entity) {
    return getPlayer().canEntityBeSeen(entity);
}

@Subscribe
public void onInput(InputEvent event) {
    if (getSetting(this).getValueByName("enable").getAsBoolean() && getPlayer().getInputManager().getIndex() == 0 && !isInWater()) {
        getJump().fixMovement(event, getPlayerController());
    }
}
public Aura() {
    this.settings = new ModeListSetting("Rotations", new BooleanSetting("Strafe", true), new BooleanSetting("Reverse", true), new BooleanSetting("Shield", true), new BooleanSetting("Abilities", true), new BooleanSetting("Potions", true), new BooleanSetting("Enchant", true));
    this.distance = new SliderSetting("Distance", 3.0f, 2.5f, 6.0f, 0.1f);
    this.rotateDistance = new SliderSetting("Rotate Distance", 1.5f, 0.0f, 3.0f, 0.1f);
    this.elytrarotate = new SliderSetting("Elytra Rotate", 1.0f, 0.0f, 30.0f, 0.05f);
    this.onlySpaceCritical = new BooleanSetting("Space Criticals", false).setVisible(() -> getSetting(this).getValueByName("Strafe").getAsBoolean());
    this.correctionType = new ModeSetting("Correction", "None", "Simple", "Smart", "Packet").setVisible(() -> getSetting(this).getValueByName("Shield").getAsBoolean());
    this.smartCorrection = new BooleanSetting("Smart Correction", false).setVisible(() -> getModeListSetting(this).is("Packet"));
    this.predictCritical = new BooleanSetting("Predict Criticals", true);
    this.stopWatch = new TimerUtil();
    this.addSettings(this.rotationMode, this.targets, this.sortMode, this.distance, this.rotateDistance, this.elytrarotate, this.settings, this.correctionType, this.onlySpaceCritical, this.smartCorrection, this.predictCritical);
}
public boolean canAttack() {
    boolean isOnGround = getPlayerController().isOnGround();
    boolean isMeleeKeyDown = getInputManager().isKeyDown();
    boolean isBow = isMeleeKeyDown && getSetting(this).get() && !getCriticalManager().isState();
    boolean isPotions = getPotionManager().isPotionActive(getPotionManager().getSpeed()) || getPotionManager().isPotionActive(getPotionManager().getStrength()) && getPlayerController().getCooledAttackStrength(1.5f) > 0.0f;
    boolean isOther = isOnLadder() || isInWater() && areEyesInFluid(isUnderwaterVision()) || isRidingHorse() || isInWeb() || isElytraFlying() || isInLava() && areEyesInFluid(isUnderlavaVision());
    if (getEntityDistance(getTarget()) <= (double)getSetting(this).get() && (isSwimming() ? getPlayerController().getCooledAttackStrength(1.5f) == 1.0f : getPlayerController().getCooledAttackStrength(1.5f) >= 0.93f)) {
        if (!isBow && getSettings(this).getValueByName("Shield").getAsBoolean()) {
            return isOnGround || !isState() && getSpeed() > 0.0f || isState() && !isBow();
        }
        return true;
    }
    return false;
}

@Subscribe
private void onRender(RenderEvent event) {
}
private void attackAndRotateOnEntity(LivingEntity livingEntity) {
    boolean isElytraFlying = getPlayerController().isElytraFlying();
    if (getPlayerController().getInputManager().getIndex() == 1 && !isElytraFlying) {
        if (shouldAttack(livingEntity)) {
            attackTarget(livingEntity);
            updateTimer(2.0f);
        }
        if (getAttackTimer() > 0.0f) {
            updateRotation(2.1474836E9f);
            setTargetRotation(getTargetRotation() - 1.0f);
        } else {
            resetRotation();
            setTargetRotation(getRotation() - 1.0f);
        }
    }
    if (getPlayerController().getInputManager().getIndex() == 0 || isElytraFlying) {
        if (shouldAttack(livingEntity)) {
            attackTarget(livingEntity);
        }
        if (!rayTraceSingleEntity(getRenderManager(), getEntity(livingEntity), getSetting(this).get(), livingEntity)) {
            updateRotation(9999.0f);
        }
    }
}
public void updateRotation() {
    if (!isRotationPaused(this)) {
        setTargetRotation(getTargetRotation() + 0.01f);
        if (getPitch(this) > 2.3) {
            setTargetRotation(2.3f);
            setRotationPaused(this, true);
        }
    } else {
        setTargetRotation(getTargetRotation() - 0.01f);
        if (getPitch(this) < -2.3) {
            setTargetRotation(-2.3f);
            setRotationPaused(this, false);
        }
    }
    setYaw(getYaw(this) + getRotationSpeed());
    setYaw(getWrappedYaw(this));
}
private void updateRotation(final float n) {
    if (shouldRotate(this)) {
        final Vector3d add = getPlayer().getPositionVec().add(0.0, Math.clamp(getRenderManager().getPosY() - getPlayer().getHeight(), 0.0, (double)(getPlayer().getHeight() / 2.0f)), 0.0).subtract(getRenderManager().getEyePosition(1.0f)).add(getPlayerController().getMotion().mul((getPlayerController().isElytraFlying() && getPlayerController().isElytraFlying()) ? 3.0 : 0.2, (getMainHandItem().isElytra() && getOffhandItem().isElytra()) ? 3.0 : 0.2, (getInventory().getArmorItem().isElytra() && getInventory().getArmorItem().isElytra()) ? 3.0 : 0.2));
        final float n2 = (float)wrapDegrees(Math.toDegrees(Math.atan2(add.x, add.z)) - 90.0);
        final float n3 = (float)(-Math.toDegrees(Math.atan2(add.x, Math.hypot(add.z, add.y))));
        final float wrapDegrees = wrapDegrees(n2 - getYaw());
        final float wrapDegrees2 = wrapDegrees(n3 - getPitch());
        final int n4 = (int)wrapDegrees;
        final String s = getModeListSetting(this).get();
        int n5 = -1;
        switch (s.hashCode()) {
            case 1337024415: {
                if (s.equals("Packet")) {
                    n5 = 0;
                    break;
                }
                break;
            }
            case -812015109: {
                if (s.equals("None")) {
                    n5 = 1;
                    break;
                }
                break;
            }
        }
        switch (n5) {
            case 0: {
                final float min = Math.min(Math.max(Math.abs(wrapDegrees), 1.0f), n);
                final float max = Math.max(Math.abs(wrapDegrees2), 1.0f);
                final float n6 = getRotationSpeed() + ((wrapDegrees > 0.0f) ? min : (-min)) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
                final float n7 = Math.clamp(getRotation() + ((wrapDegrees2 > 0.0f) ? max : (-max)), -89.0f, 89.0f) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
                setTargetRotation(new Vector3f(n6 - (n6 - getGCDValue()), n7 - (n7 - getGCDValue())));
                setMin(min);
                setMax(max);
                break;
            }
            case 1: {
                final float n8 = getYaw() + n4;
                final float clamp = Math.clamp(getPitch() + wrapDegrees2, -90.0f, 90.0f);
                final float gcdValue = getGCDValue();
                setTargetRotation(new Vector3f(n8 - (n8 - getGCDValue()), clamp - (clamp - getGCDValue())));
                break;
            }
        }
    }
    else {
    final Vector3d subtract = getPlayer().getPositionVec().add(0.0, Math.clamp(getRenderManager().getPosY() - getPlayer().getHeight(), 0.0, (double)(getPlayer().getHeight() / 2.0f)), 0.0).subtract(getRenderManager().getEyePosition(1.0f));
    final float n9 = (float)wrapDegrees(Math.toDegrees(Math.atan2(subtract.x, subtract.z)) - 90.0);
    final float n10 = (float)(-Math.toDegrees(Math.atan2(subtract.x, Math.hypot(subtract.z, subtract.y))));
    final float wrapDegrees3 = wrapDegrees(n9 - getYaw());
    final float wrapDegrees4 = wrapDegrees(n10 - getPitch());
    final int n11 = (int)wrapDegrees3;
    final String s2 = getModeListSetting(this).get();
    int n12 = -1;
    switch (s2.hashCode()) {
        case 1337024415: {
            if (s2.equals("Packet")) {
                n12 = 0;
                break;
            }
            break;
        }
        case -812015109: {
            if (s2.equals("None")) {
                n12 = 1;
                break;
            }
            break;
        }
    }
    switch (n12) {
        case 0: {
            final float min2 = Math.min(Math.max(Math.abs(wrapDegrees3), 1.0f), n);
            final float max2 = Math.max(Math.abs(wrapDegrees4), partum);
            final float n13 = getRotationSpeed() + ((wrapDegrees3 > 0.0f) ? min2 : (-min2)) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
            final float n14 = Math.clamp(getRotation() + ((wrapDegrees4 > 0.0f) ? max2 : (-max2)), -89.0f, 89.0f) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
            setTargetRotation(new Vector3f(n13 - (n13 - getGCDValue()), n14 - (n14 - getGCDValue())));
            setMin(min2);
            setMax(max2);
            break;
        }
        case 1: {
            final float n15 = getYaw() + n11;
            final float clamp2 = Math.clamp(getPitch() + wrapDegrees4, -90.0f, 90.0f);
            final float gcdValue2 = getGCDValue();
            setTargetRotation(new Vector3f(n15 - (n15 - getGCDValue()), clamp2 - (clamp2 - getGCDValue())));
            break;
        }
    }
}
}
public static Vector3d getVector(final Entity entity) {
    final double n = entity.getWidth() * entity.getWidth() * entity.getWidth() * entity.getWidth();
    return new Vector3d(entity.getPosX() - getPlayer().getPosX() + Math.clamp(getRenderManager().getPosX() - entity.getPosX(), -n, n), entity.getPosY() - getPlayer().getPosYEye() + Math.clamp(entity.getPosYEye() - entity.getPosY(), 0.0, entity.getHeight() / 1.7), entity.getPosZ() - getPlayer().getPosZ() + Math.clamp(getRenderManager().getPosZ() - entity.getPosZ(), -n, n));
}
@Subscribe
private void onVisualRotate(final RotationEvent event) {
    if (!(event.getEntity() instanceof Entity)) {
        return;
    }
    if (getAttackTimer() == null) {
        return;
    }
}
private /* synthetic */ double lambda$findTarget$3(final Object o) {
    if (o instanceof final Player player) {
        return -getEntityArmor(player);
    }
    if (o instanceof final LivingEntity livingEntity) {
        return -livingEntity.getTotalArmorValue();
    }
    return 0.0;
}
private void breakShieldAndSwapSlot() {
    final Entity entity = getTarget();
    if (entity instanceof final Player player) {
        if (getFunctionRegistry().getAutoPotion().isActive() && !player.isSpectator() && !player.isCreative() && (getInventory().getHeldItemOffhand().getItem() == getFunctionRegistry().getShield() || getInventory().getHeldItemMainhand().getItem() == getFunctionRegistry().getSword())) {
            final int breakShield = this.breakShield((LivingEntity) player);
            if (breakShield > 8) {
                getPlayerController().pickItem(breakShield);
            }
        }
    }
}
private double getDistance(final Entity entity) {
    return getVector(entity).length();
}

private double getProtectionLvl(final ItemStack itemStack) {
    double n = itemStack.getDamageReduceAmount();
    if (itemStack.isEnchanted()) {
        n += EnchantmentHelper.getEnchantmentLevel(getFunctionRegistry().getProtection(), itemStack) * 0.25;
    }
    return n;
}
private static void setRenderYawOffset(final Entity entity, final float renderYawOffset) {
    entity.renderYawOffset = renderYawOffset;
}
static {
    Aura.target = null;
    Aura.fakeRotateVector = new Vector3f(0.0f, 0.0f);
    Aura.fakePrevRotateVector = new Vector3f(0.0f, 0.0f);
    Aura.rotate = new Vector3f(0.0f, 0.0f);
}
public double getEntityArmor(final Player player) {
    double n = 0.0;
    for (final ItemStack itemStack : getPlayer().getArmorItems()) {
        if (itemStack != null && itemStack.getItem() instanceof ArmorItem) {
            n += this.getProtectionLvl(itemStack);
        }
    }
    return n;
}
@Override
public void onDisable() {
    setTargetRotation(new Vector3f(getRenderManager().getRenderYawOffset(getPlayer()), getRenderManager().getRenderPitchOffset(getPlayer())));
    setTarget(null);
    setAttackTimer(null);
    setAttackTimer(this, System.currentTimeMillis());
    super.onDisable();
}
public double getEntityHealth(final Entity entity) {
    if (entity instanceof final Player player) {
        return (player.getHealth() + player.getAbsorptionAmount()) * (this.getEntityArmor(player) / 20.0);
    }
    if (entity instanceof final LivingEntity livingEntity) {
        return livingEntity.getHealth() + livingEntity.getAbsorptionAmount();
    }
    return 0.0;
}
}
Всем похуй , "деобф" сделал нахуй) ты максимум что сделал это в мои профилактиновые яички упал и плачешь
 
Начинающий
Статус
Оффлайн
Регистрация
8 Мар 2024
Сообщения
613
Реакции[?]
2
Поинты[?]
2K
ты пастить это реально собрался?
Всем похуй , "деобф" сделал нахуй) ты максимум что сделал это в мои профилактиновые яички упал и плачешь
:derjiban:
Скинь сам сурс пжшка
я не по сурсам обфаю а по классам
 
Последнее редактирование:
Забаненный
Статус
Оффлайн
Регистрация
27 Май 2024
Сообщения
265
Реакции[?]
10
Поинты[?]
10K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
ты пастить это реально собрался?

:derjiban:

я не по сурсам обфаю а по классам
типо не кринжовый ребенок) ххахахх . " я не по сурсам обфаю а по классам " - ты ваще больной или че?) Ты "обфусцируешь" отдельно по классам чит и пишешь, что ты типо деобф сделал) В глаза долбишься pastерок
 
Начинающий
Статус
Оффлайн
Регистрация
3 Окт 2022
Сообщения
165
Реакции[?]
1
Поинты[?]
1K
(помощник) кодера был слишком выёбчивым и тупым и я сливаю вам это горе пасто килку ,если хотите солью худ :da:

Код:
import net.minecraft.EnchantmentHelper;
import net.minecraft.Entity;
import net.minecraft.ItemStack;
import net.minecraft.Player;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.Mouse;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.Matrix4f;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.util.math.Vector3d;
import net.minecraft.client.util.math.Vector3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.goal.GoalSelector;
import net.minecraft.entity.ai.goal.MoveTowardsRestriction;
import net.minecraft.entity.ai.goal.MoveTowardsTarget;
import net.minecraft.entity.ai.goal.PrioritizedGoal;
import net.minecraft.entity.player.PlayerAbilities;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.PacketPlayInArmAnimation;
import net.minecraft.network.packet.c2s.PacketPlayInBlockPlace;
import net.minecraft.network.packet.c2s.PacketPlayInUseItem;
import net.minecraft.network.packet.c2s.PacketPlayInSteerVehicle;
import net.minecraft.network.packet.c2s.PacketPlayInWindowClick;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.RecipeType;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.TypedActionResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import ru.vorkis.Aura;
import ru.vorkis.AuraConfig;
import ru.vorkis.functions.settings.Setting;
import ru.vorkis.functions.settings.SettingsManager;
import ru.vorkis.functions.settings.impl.ModeListSetting;
import ru.vorkis.functions.settings.impl.BooleanSetting;
import ru.vorkis.functions.settings.impl.ModeSetting;
import ru.vorkis.functions.settings.impl.SliderSetting;
import ru.vorkis.functions.api.Category;
import ru.vorkis.functions.api.FunctionRegister;
import ru.vorkis.functions.api.Function;
import ru.vorkis.Main;
import ru.vorkis.utils.Timer;
import ru.vorkis.utils.TimerUtil;
import ru.vorkis.utils.TimerUtil.TimeType;
import ru.vorkis.utils.misc.MathUtils;
import ru.vorkis.utils.misc.TimerUtils;
import ru.vorkis.utils.PlayerUtils;
import ru.vorkis.utils.PlayerUtils.InputManager;
import ru.vorkis.utils.PlayerUtils.RenderManager;
import ru.vorkis.utils.events.AttackTimerEvent;
import ru.vorkis.utils.events.InputEvent;
import ru.vorkis.utils.events.RenderEvent;
import ru.vorkis.utils.events.UpdateEvent;
import ru.vorkis.utils.events.VisualRotateEvent;
import ru.vorkis.utils.events.WeaponSwapEvent;
import com.google.common.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import net.minecraft.client.render.Camera.CameraProjection;

@FunctionRegister(
    name = "Aura",
    type = Category.COMBAT
)
public class Aura extends Function {

public float rotationSpeed = 0.0f;
public SliderSetting rotateDistance;
public boolean isReversing = false;
public ModeSetting rotationMode = new ModeSetting(
    "forward",
    "back",
    "reverse",
    "strafe"
);
public SliderSetting elytrarotate;
public float lastYaw;
private final float maxRotationSpeed = 1.5f;
public BooleanSetting smartCorrection;
private final float acceleration = 0.01f;
public float rotationAngle = 0.0f;
public SliderSetting distance;
public ModeListSetting settings;
private ModeSetting sortMode = new ModeSetting(
    "Normal",
    "Top",
    "Bottom",
    "Top",
    "Bottom"
);
private long cpsLimit = 0L;
private TimerUtil stopWatch;
private Vector3f fakePrevRotateVector;
private Vector3f fakeRotateVector;
private boolean hasRotated;
public Entity target;
public float ticksUntilNextAttack;
public BooleanSetting onlySpaceCritical;
public BooleanSetting predictCritical;
public ModeListSetting targets = new ModeListSetting(
    "Closest",
    new BooleanSetting("No_Shield", true),
    new BooleanSetting("No_Abilities", false),
    new BooleanSetting("No_Potions", true),
    new BooleanSetting("No_Enchant", false),
    new BooleanSetting("No_Projectiles", false)
);
public ModeSetting correctionType;
public float lastPitch;
public Vector3f rotate;

   static float getYaw(Entity entity) {
    return entity.rotationYaw;
}

    private void attackTarget(Entity targetEntity) {
        if (((Boolean)getSettingValue("critical_anti_cooldown")).booleanValue() && MinecraftServer.getServer().playerInteractionManager.isBlocking(Minecraft.get HillePlayer())) {
            Callback.onStoppedUsingItem(Item.getIdFromItem(Minecraft.getHillePlayer().getItemInHand(Hand.MAIN_HAND)));
        }
        boolean sentPacket = false;
        if (Minecraft.getFrameWorld().isClient && !Minecraft.getHillePlayer().isOnGround() && !Minecraft.getHillePlayer().isTouchingWater()) {
            Minecraft.getNetworkHandler().sendPacket(new CPlayerPacket(Packets.PLAY_CLIENTbound.ON_USE_ENTITY, Minecraft.getHillePlayer().getId()));
            sentPacket = true;
        }
        long time = Minecraft.isOnServer ? System.currentTimeMillis() : System.currentTimeMillis() + 550;
        Callback.attackEntity(targetEntity, Minecraft.getHillePlayer());
        Minecraft.getHillePlayer().swingHand(Hand.MAIN_HAND);
        if (((Boolean)getSettingValue("break_shield")).booleanValue()) {
            this.breakShieldAndSwapSlot();
        }
        if (sentPacket) {
            Minecraft.getNetworkHandler().sendPacket(new CPlayerPacket(Packets.PLAY_CLIENTbound.ANIMATION, Minecraft.getHillePlayer().getId(), Minecraft.getHillePlayer().getMainArm().getId(), EnumHand.MAIN_HAND));
        }
    }

    public int breakShield(AttackSource source) {
    int axeSlot = inventory.getAxe(true);
    if (axeSlot != -1) {
        packetSender.sendPacket(new UseItemPacket(axeSlot));
        attackSource.attackEntity(getTarget(), sourceType);
        armSwing.swingArm();
        packetSender.sendPacket(new UseItemPacket(useItem(getOffhandSlot(isEating()))));
        return axeSlot;
    }
    axeSlot = inventory.getAxe(false);
    if (axeSlot != -1) {
        itemInteracter.pickItem(axeSlot);
        attackSource.attackEntity(getTarget(), sourceType);
        armSwing.swingArm();
        return axeSlot;
    }
    return -1;
}
    private void handleMotionEvent(MotionEvent event) {
    if (event == null || Main.getInst().getFunctionRegistry().getAutoPotion().isActive()) {
        return;
    }
    event.setYaw(getYaw(event.getPointerId(0)));
    event.setPitch(getPitch(event.getPointerId(1)));
    Aura.setX(getX(Aura.getPointerId(0)), getX(Aura.getPointerId(1)));
    Aura.setY(getY(Aura.getPointerId(0)), getY(Aura.getPointerId(1)));
    Aura.setPressure(getPressure(Aura.getPointerId(0)), getPressure(Aura.getPointerId(1)));
}
public static float rotate(float current, float target, float min, float max) {
    float delta = Math.copySign(Math.min(0.6f, Math.abs(target - current)), target - current);
    delta = Math.min(delta, Math.abs(min)) * Math.signum(min);
    delta = Math.min(delta, Math.abs(max)) * Math.signum(max);
    if (Math.abs(delta) > Math.abs(target - current)) {
        return target;
    }
    return current + delta;
}
private void findTarget() {
    List<Entity> entities = new ArrayList<>();
    for (Entity entity : getSortedTargets()) {
        if (!(entity instanceof LivingEntity) || !isValidTarget((LivingEntity) entity)) continue;
        entities.add(entity);
    }
    if (entities.isEmpty()) {
        setTarget(null);
        return;
    }
    if (entities.size() == 1) {
        setTarget((LivingEntity) entities.get(0));
        return;
    }
    entities.sort(Comparator.comparingDouble(entity -> {
        if (entity instanceof Player) {
            Player player = (Player) entity;
            return -getEntityArmor(player);
        }
        if (entity instanceof LivingEntity) {
            LivingEntity livingEntity = (LivingEntity) entity;
            return -livingEntity.getTotalArmorValue();
        }
        return 0.0;
    }).thenComparing((entity, entity2) -> {
        double health1 = getEntityHealth(entity);
        double health2 = getEntityHealth(entity2);
        return Double.compare(health1, health2);
    }).thenComparing((entity, entity2) -> {
        double distance1 = getEntityDistance(entity);
        double distance2 = getEntityDistance(entity2);
        return Double.compare(distance1, distance2);
    }));
    setTarget((LivingEntity) entities.get(0));
}
@Subscribe
private void onUpdate(UpdateEvent event) {
    if (getCurrentTarget() != null) {
        updateRotation();
        setTargetRotation(new Vector3f(wrapDegrees(getYaw() + 25.0f), getPitch(), 0.0f), 40.0f);
    }
    if (getTarget() == null || !isValidTarget(getTarget())) {
        findTarget();
    }
    if (getAttackTimer() == null) {
        setAttackTimer(this, System.currentTimeMillis());
        setTargetRotation(new Vector3f(smoothStep(getYaw(), getTargetYaw(), getSmoothness()), getSmoothStep(getPitch(), getTargetPitch()), 0.0f), Aura.getSmoothness());
        return;
    }
    attackAndRotateOnEntity(getTarget());
}
private boolean canSeeThroughWall(Entity entity) {
    return getPlayer().canEntityBeSeen(entity);
}

@Subscribe
public void onInput(InputEvent event) {
    if (getSetting(this).getValueByName("enable").getAsBoolean() && getPlayer().getInputManager().getIndex() == 0 && !isInWater()) {
        getJump().fixMovement(event, getPlayerController());
    }
}
public Aura() {
    this.settings = new ModeListSetting("Rotations", new BooleanSetting("Strafe", true), new BooleanSetting("Reverse", true), new BooleanSetting("Shield", true), new BooleanSetting("Abilities", true), new BooleanSetting("Potions", true), new BooleanSetting("Enchant", true));
    this.distance = new SliderSetting("Distance", 3.0f, 2.5f, 6.0f, 0.1f);
    this.rotateDistance = new SliderSetting("Rotate Distance", 1.5f, 0.0f, 3.0f, 0.1f);
    this.elytrarotate = new SliderSetting("Elytra Rotate", 1.0f, 0.0f, 30.0f, 0.05f);
    this.onlySpaceCritical = new BooleanSetting("Space Criticals", false).setVisible(() -> getSetting(this).getValueByName("Strafe").getAsBoolean());
    this.correctionType = new ModeSetting("Correction", "None", "Simple", "Smart", "Packet").setVisible(() -> getSetting(this).getValueByName("Shield").getAsBoolean());
    this.smartCorrection = new BooleanSetting("Smart Correction", false).setVisible(() -> getModeListSetting(this).is("Packet"));
    this.predictCritical = new BooleanSetting("Predict Criticals", true);
    this.stopWatch = new TimerUtil();
    this.addSettings(this.rotationMode, this.targets, this.sortMode, this.distance, this.rotateDistance, this.elytrarotate, this.settings, this.correctionType, this.onlySpaceCritical, this.smartCorrection, this.predictCritical);
}
public boolean canAttack() {
    boolean isOnGround = getPlayerController().isOnGround();
    boolean isMeleeKeyDown = getInputManager().isKeyDown();
    boolean isBow = isMeleeKeyDown && getSetting(this).get() && !getCriticalManager().isState();
    boolean isPotions = getPotionManager().isPotionActive(getPotionManager().getSpeed()) || getPotionManager().isPotionActive(getPotionManager().getStrength()) && getPlayerController().getCooledAttackStrength(1.5f) > 0.0f;
    boolean isOther = isOnLadder() || isInWater() && areEyesInFluid(isUnderwaterVision()) || isRidingHorse() || isInWeb() || isElytraFlying() || isInLava() && areEyesInFluid(isUnderlavaVision());
    if (getEntityDistance(getTarget()) <= (double)getSetting(this).get() && (isSwimming() ? getPlayerController().getCooledAttackStrength(1.5f) == 1.0f : getPlayerController().getCooledAttackStrength(1.5f) >= 0.93f)) {
        if (!isBow && getSettings(this).getValueByName("Shield").getAsBoolean()) {
            return isOnGround || !isState() && getSpeed() > 0.0f || isState() && !isBow();
        }
        return true;
    }
    return false;
}

@Subscribe
private void onRender(RenderEvent event) {
}
private void attackAndRotateOnEntity(LivingEntity livingEntity) {
    boolean isElytraFlying = getPlayerController().isElytraFlying();
    if (getPlayerController().getInputManager().getIndex() == 1 && !isElytraFlying) {
        if (shouldAttack(livingEntity)) {
            attackTarget(livingEntity);
            updateTimer(2.0f);
        }
        if (getAttackTimer() > 0.0f) {
            updateRotation(2.1474836E9f);
            setTargetRotation(getTargetRotation() - 1.0f);
        } else {
            resetRotation();
            setTargetRotation(getRotation() - 1.0f);
        }
    }
    if (getPlayerController().getInputManager().getIndex() == 0 || isElytraFlying) {
        if (shouldAttack(livingEntity)) {
            attackTarget(livingEntity);
        }
        if (!rayTraceSingleEntity(getRenderManager(), getEntity(livingEntity), getSetting(this).get(), livingEntity)) {
            updateRotation(9999.0f);
        }
    }
}
public void updateRotation() {
    if (!isRotationPaused(this)) {
        setTargetRotation(getTargetRotation() + 0.01f);
        if (getPitch(this) > 2.3) {
            setTargetRotation(2.3f);
            setRotationPaused(this, true);
        }
    } else {
        setTargetRotation(getTargetRotation() - 0.01f);
        if (getPitch(this) < -2.3) {
            setTargetRotation(-2.3f);
            setRotationPaused(this, false);
        }
    }
    setYaw(getYaw(this) + getRotationSpeed());
    setYaw(getWrappedYaw(this));
}
private void updateRotation(final float n) {
    if (shouldRotate(this)) {
        final Vector3d add = getPlayer().getPositionVec().add(0.0, Math.clamp(getRenderManager().getPosY() - getPlayer().getHeight(), 0.0, (double)(getPlayer().getHeight() / 2.0f)), 0.0).subtract(getRenderManager().getEyePosition(1.0f)).add(getPlayerController().getMotion().mul((getPlayerController().isElytraFlying() && getPlayerController().isElytraFlying()) ? 3.0 : 0.2, (getMainHandItem().isElytra() && getOffhandItem().isElytra()) ? 3.0 : 0.2, (getInventory().getArmorItem().isElytra() && getInventory().getArmorItem().isElytra()) ? 3.0 : 0.2));
        final float n2 = (float)wrapDegrees(Math.toDegrees(Math.atan2(add.x, add.z)) - 90.0);
        final float n3 = (float)(-Math.toDegrees(Math.atan2(add.x, Math.hypot(add.z, add.y))));
        final float wrapDegrees = wrapDegrees(n2 - getYaw());
        final float wrapDegrees2 = wrapDegrees(n3 - getPitch());
        final int n4 = (int)wrapDegrees;
        final String s = getModeListSetting(this).get();
        int n5 = -1;
        switch (s.hashCode()) {
            case 1337024415: {
                if (s.equals("Packet")) {
                    n5 = 0;
                    break;
                }
                break;
            }
            case -812015109: {
                if (s.equals("None")) {
                    n5 = 1;
                    break;
                }
                break;
            }
        }
        switch (n5) {
            case 0: {
                final float min = Math.min(Math.max(Math.abs(wrapDegrees), 1.0f), n);
                final float max = Math.max(Math.abs(wrapDegrees2), 1.0f);
                final float n6 = getRotationSpeed() + ((wrapDegrees > 0.0f) ? min : (-min)) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
                final float n7 = Math.clamp(getRotation() + ((wrapDegrees2 > 0.0f) ? max : (-max)), -89.0f, 89.0f) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
                setTargetRotation(new Vector3f(n6 - (n6 - getGCDValue()), n7 - (n7 - getGCDValue())));
                setMin(min);
                setMax(max);
                break;
            }
            case 1: {
                final float n8 = getYaw() + n4;
                final float clamp = Math.clamp(getPitch() + wrapDegrees2, -90.0f, 90.0f);
                final float gcdValue = getGCDValue();
                setTargetRotation(new Vector3f(n8 - (n8 - getGCDValue()), clamp - (clamp - getGCDValue())));
                break;
            }
        }
    }
    else {
    final Vector3d subtract = getPlayer().getPositionVec().add(0.0, Math.clamp(getRenderManager().getPosY() - getPlayer().getHeight(), 0.0, (double)(getPlayer().getHeight() / 2.0f)), 0.0).subtract(getRenderManager().getEyePosition(1.0f));
    final float n9 = (float)wrapDegrees(Math.toDegrees(Math.atan2(subtract.x, subtract.z)) - 90.0);
    final float n10 = (float)(-Math.toDegrees(Math.atan2(subtract.x, Math.hypot(subtract.z, subtract.y))));
    final float wrapDegrees3 = wrapDegrees(n9 - getYaw());
    final float wrapDegrees4 = wrapDegrees(n10 - getPitch());
    final int n11 = (int)wrapDegrees3;
    final String s2 = getModeListSetting(this).get();
    int n12 = -1;
    switch (s2.hashCode()) {
        case 1337024415: {
            if (s2.equals("Packet")) {
                n12 = 0;
                break;
            }
            break;
        }
        case -812015109: {
            if (s2.equals("None")) {
                n12 = 1;
                break;
            }
            break;
        }
    }
    switch (n12) {
        case 0: {
            final float min2 = Math.min(Math.max(Math.abs(wrapDegrees3), 1.0f), n);
            final float max2 = Math.max(Math.abs(wrapDegrees4), partum);
            final float n13 = getRotationSpeed() + ((wrapDegrees3 > 0.0f) ? min2 : (-min2)) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
            final float n14 = Math.clamp(getRotation() + ((wrapDegrees4 > 0.0f) ? max2 : (-max2)), -89.0f, 89.0f) + getSensitivity((float) (Math.cos((double) (System.currentTimeMillis() / 50L)) * 7.0));
            setTargetRotation(new Vector3f(n13 - (n13 - getGCDValue()), n14 - (n14 - getGCDValue())));
            setMin(min2);
            setMax(max2);
            break;
        }
        case 1: {
            final float n15 = getYaw() + n11;
            final float clamp2 = Math.clamp(getPitch() + wrapDegrees4, -90.0f, 90.0f);
            final float gcdValue2 = getGCDValue();
            setTargetRotation(new Vector3f(n15 - (n15 - getGCDValue()), clamp2 - (clamp2 - getGCDValue())));
            break;
        }
    }
}
}
public static Vector3d getVector(final Entity entity) {
    final double n = entity.getWidth() * entity.getWidth() * entity.getWidth() * entity.getWidth();
    return new Vector3d(entity.getPosX() - getPlayer().getPosX() + Math.clamp(getRenderManager().getPosX() - entity.getPosX(), -n, n), entity.getPosY() - getPlayer().getPosYEye() + Math.clamp(entity.getPosYEye() - entity.getPosY(), 0.0, entity.getHeight() / 1.7), entity.getPosZ() - getPlayer().getPosZ() + Math.clamp(getRenderManager().getPosZ() - entity.getPosZ(), -n, n));
}
@Subscribe
private void onVisualRotate(final RotationEvent event) {
    if (!(event.getEntity() instanceof Entity)) {
        return;
    }
    if (getAttackTimer() == null) {
        return;
    }
}
private /* synthetic */ double lambda$findTarget$3(final Object o) {
    if (o instanceof final Player player) {
        return -getEntityArmor(player);
    }
    if (o instanceof final LivingEntity livingEntity) {
        return -livingEntity.getTotalArmorValue();
    }
    return 0.0;
}
private void breakShieldAndSwapSlot() {
    final Entity entity = getTarget();
    if (entity instanceof final Player player) {
        if (getFunctionRegistry().getAutoPotion().isActive() && !player.isSpectator() && !player.isCreative() && (getInventory().getHeldItemOffhand().getItem() == getFunctionRegistry().getShield() || getInventory().getHeldItemMainhand().getItem() == getFunctionRegistry().getSword())) {
            final int breakShield = this.breakShield((LivingEntity) player);
            if (breakShield > 8) {
                getPlayerController().pickItem(breakShield);
            }
        }
    }
}
private double getDistance(final Entity entity) {
    return getVector(entity).length();
}

private double getProtectionLvl(final ItemStack itemStack) {
    double n = itemStack.getDamageReduceAmount();
    if (itemStack.isEnchanted()) {
        n += EnchantmentHelper.getEnchantmentLevel(getFunctionRegistry().getProtection(), itemStack) * 0.25;
    }
    return n;
}
private static void setRenderYawOffset(final Entity entity, final float renderYawOffset) {
    entity.renderYawOffset = renderYawOffset;
}
static {
    Aura.target = null;
    Aura.fakeRotateVector = new Vector3f(0.0f, 0.0f);
    Aura.fakePrevRotateVector = new Vector3f(0.0f, 0.0f);
    Aura.rotate = new Vector3f(0.0f, 0.0f);
}
public double getEntityArmor(final Player player) {
    double n = 0.0;
    for (final ItemStack itemStack : getPlayer().getArmorItems()) {
        if (itemStack != null && itemStack.getItem() instanceof ArmorItem) {
            n += this.getProtectionLvl(itemStack);
        }
    }
    return n;
}
@Override
public void onDisable() {
    setTargetRotation(new Vector3f(getRenderManager().getRenderYawOffset(getPlayer()), getRenderManager().getRenderPitchOffset(getPlayer())));
    setTarget(null);
    setAttackTimer(null);
    setAttackTimer(this, System.currentTimeMillis());
    super.onDisable();
}
public double getEntityHealth(final Entity entity) {
    if (entity instanceof final Player player) {
        return (player.getHealth() + player.getAbsorptionAmount()) * (this.getEntityArmor(player) / 20.0);
    }
    if (entity instanceof final LivingEntity livingEntity) {
        return livingEntity.getHealth() + livingEntity.getAbsorptionAmount();
    }
    return 0.0;
}
}
ебашь худ, я скачал недо-деобф рогалика там все классы поломаны(
 
Сверху Снизу