Исходник Dick client src 1.16.5 Exp2.0| intellj idea ready

Начинающий
Статус
Оффлайн
Регистрация
14 Окт 2024
Сообщения
47
Реакции[?]
1
Поинты[?]
1K
Начинающий
Статус
Оффлайн
Регистрация
18 Сен 2022
Сообщения
111
Реакции[?]
0
Поинты[?]
0
Начинающий
Статус
Оффлайн
Регистрация
29 Май 2024
Сообщения
469
Реакции[?]
2
Поинты[?]
1K
ну прикрепи скрин худа код посмотрю
Java:
package wtf.expensive.modules.impl.combat;

import com.mojang.blaze3d.systems.RenderSystem;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.concurrent.ThreadLocalRandom;
import net.minecraft.client.renderer.WorldVertexBufferUploader;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.item.ArmorStandEntity;
import net.minecraft.entity.merchant.villager.VillagerEntity;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.entity.monster.SlimeEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.passive.WaterMobEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.play.client.CEntityActionPacket;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.potion.Effects;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;
import org.lwjgl.opengl.GL11;
import wtf.expensive.events.Event;
import wtf.expensive.events.impl.player.EventInput;
import wtf.expensive.events.impl.player.EventInteractEntity;
import wtf.expensive.events.impl.player.EventMotion;
import wtf.expensive.events.impl.player.EventUpdate;
import wtf.expensive.events.impl.player.EventWorldChange;
import wtf.expensive.events.impl.render.EventRender;
import wtf.expensive.managment.Managment;
import wtf.expensive.modules.Function;
import wtf.expensive.modules.FunctionAnnotation;
import wtf.expensive.modules.Type;
import wtf.expensive.modules.settings.imp.BooleanOption;
import wtf.expensive.modules.settings.imp.ModeSetting;
import wtf.expensive.modules.settings.imp.MultiBoxSetting;
import wtf.expensive.modules.settings.imp.SliderSetting;
import wtf.expensive.util.ClientUtil;
import wtf.expensive.util.math.GCDUtil;
import wtf.expensive.util.math.RayTraceUtil;
import wtf.expensive.util.movement.MoveUtil;
import wtf.expensive.util.render.RenderUtil;
import wtf.expensive.util.world.InventoryUtil;

@FunctionAnnotation(name="Aura", type=Type.Combat)
public class AuraNew
extends Function {
    private final ModeSetting mode = new ModeSetting("\u0420\u0435\u0436\u0438\u043c \u0440\u043e\u0442\u0430\u0446\u0438\u0438", "\u0421\u043d\u0430\u043f\u044b", "\u041e\u0431\u044b\u0447\u043d\u0430\u044f", "\u0421\u043d\u0430\u043f\u044b");
    private final SliderSetting range = new SliderSetting("\u0414\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u044f", 3.0f, 3.0f, 6.0f, 0.05f);
    private final SliderSetting preRange = new SliderSetting("\u0414\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u0440\u043e\u0442\u0430\u0446\u0438\u0438", 0.5f, 0.0f, 3.0f, 0.05f).setVisible(() -> this.mode.is("\u041e\u0431\u044b\u0447\u043d\u0430\u044f"));
    private final MultiBoxSetting targets = new MultiBoxSetting("\u0426\u0435\u043b\u0438", new BooleanOption("\u0418\u0433\u0440\u043e\u043a\u0438", true), new BooleanOption("\u0416\u0438\u0432\u043e\u0442\u043d\u044b\u0435", false), new BooleanOption("\u041c\u043e\u043d\u0441\u0442\u0440\u044b", false));
    private final MultiBoxSetting ignore = new MultiBoxSetting("\u0418\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c", new BooleanOption("\u0414\u0440\u0443\u0437\u0435\u0439", true), new BooleanOption("\u041d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0445", false), new BooleanOption("\u0413\u043e\u043b\u044b\u0445", false), new BooleanOption("\u0411\u043e\u0442\u043e\u0432", true));
    private final ModeSetting sort = new ModeSetting("\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c", "\u041f\u043e \u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u0438", "\u041f\u043e \u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u0438", "\u041f\u043e \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044e", "\u041f\u043e \u043f\u043e\u043b\u044e \u0437\u0440\u0435\u043d\u0438\u044f");
    public final MultiBoxSetting settings = new MultiBoxSetting("\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438", new BooleanOption("\u0422\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0438\u0442\u0430\u043c\u0438", true), new BooleanOption("\u041a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044f \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f", true), new BooleanOption("\u041d\u0435 \u0431\u0438\u0442\u044c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438", false), new BooleanOption("\u041e\u0442\u0436\u0438\u043c\u0430\u0442\u044c \u0449\u0438\u0442", true), new BooleanOption("\u041b\u043e\u043c\u0430\u0442\u044c \u0449\u0438\u0442", true));
    private final BooleanOption space = new BooleanOption("\u041a\u0440\u0438\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u043c", false).setVisible(() -> this.settings.get(0));
    private final BooleanOption silent = new BooleanOption("\u0421\u0430\u0439\u043b\u0435\u043d\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044f", true).setVisible(() -> this.settings.get(1));
    private long cpsLimit = 0L;
    LivingEntity target;
    float rotYaw;
    float rotPitch;
    int ticks;

    public AuraNew() {
        this.addSettings(this.range, this.preRange, this.mode, this.targets, this.ignore, this.sort, this.settings, this.space, this.silent);
    }

    @Override
    public void onEvent(Event event) {
        Event e;
        if (AuraNew.mc.player == null || AuraNew.mc.world == null) {
            return;
        }
        if (event instanceof EventInteractEntity) {
            EventInteractEntity entity = (EventInteractEntity)event;
            if (this.target != null) {
                entity.setCancel(true);
            }
        }
        if (event instanceof EventInput) {
            e = (EventInput)event;
            if (this.settings.get(1) && this.silent.get()) {
                MoveUtil.fixMovement((EventInput)e, this.rotYaw);
            }
        }
        if (event instanceof EventUpdate) {
            this.target = this.findTarget();
            if (this.target == null) {
                this.reset();
                return;
            }
            switch (this.mode.getIndex()) {
                case 0: {
                    this.updateRotation(0.5f);
                    if (!this.canAttack() || RayTraceUtil.getMouseOver(this.target, this.rotYaw, this.rotPitch, this.range.getValue().floatValue()) != this.target) break;
                    this.updateAttack(this.target);
                    break;
                }
                case 1: {
                    if (this.canAttack()) {
                        this.updateAttack(this.target);
                        this.ticks = 3;
                    }
                    if (this.ticks > 0) {
                        this.updateRotation(1.0f);
                        --this.ticks;
                        break;
                    }
                    this.rotYaw = AuraNew.mc.player.rotationYaw;
                    this.rotPitch = AuraNew.mc.player.rotationPitch;
                }
            }
        }
        if (event instanceof EventMotion) {
            e = (EventMotion)event;
            if (this.target == null) {
                return;
            }
            ((EventMotion)e).setYaw(this.rotYaw);
            ((EventMotion)e).setPitch(this.rotPitch);
            this.updateClientRotation(this.rotYaw, this.rotPitch);
        }
        if (event instanceof EventWorldChange) {
            this.reset();
        }
        if (!(event instanceof EventRender) || !((EventRender)(e = (EventRender)event)).isRender3D() || this.target != null) {
            // empty if block
        }
    }

    private void updateRotation(float speed2) {
        if (this.isInHitBox(AuraNew.mc.player, this.target)) {
            return;
        }
        Vector3d vec3d = this.getVector3d(AuraNew.mc.player, this.target);
        float rawYaw = (float)MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(vec3d.z, vec3d.x)) - 90.0);
        float rawPitch = (float)MathHelper.wrapDegrees(Math.toDegrees(-Math.atan2(vec3d.y, Math.hypot(vec3d.x, vec3d.z))));
        float yawDelta = MathHelper.wrapDegrees(rawYaw - this.rotYaw);
        float pitchDelta = MathHelper.wrapDegrees(rawPitch - this.rotPitch);
        if (Math.abs(yawDelta) > 180.0f) {
            yawDelta -= Math.signum(yawDelta) * 360.0f;
        }
        float additionYaw = MathHelper.clamp(yawDelta, -180.0f * speed2, 180.0f * speed2);
        float additionPitch = MathHelper.clamp(pitchDelta, -90.0f * speed2, 90.0f * speed2);
        float yaw2 = this.rotYaw + additionYaw + ThreadLocalRandom.current().nextFloat(-1.0f, 1.0f);
        float pitch2 = this.rotPitch + additionPitch + ThreadLocalRandom.current().nextFloat(-1.0f, 1.0f);
        this.rotYaw = GCDUtil.getSensitivity(yaw2);
        this.rotPitch = GCDUtil.getSensitivity(MathHelper.clamp(pitch2, -89.0f, 89.0f));
    }

    private void updateAttack(LivingEntity target) {
        if (AuraNew.mc.player.isHandActive()) {
            if (this.settings.get(3) && AuraNew.mc.player.isActiveItemStackBlocking()) {
                AuraNew.mc.playerController.onStoppedUsingItem(AuraNew.mc.player);
            } else if (this.settings.get(2)) {
                return;
            }
        }
        boolean sprint = false;
        if (this.settings.get(0) && CEntityActionPacket.lastUpdatedSprint) {
            AuraNew.mc.player.connection.sendPacket(new CEntityActionPacket(AuraNew.mc.player, CEntityActionPacket.Action.STOP_SPRINTING));
            if (!AuraNew.mc.player.isInWater()) {
                AuraNew.mc.player.setSprinting(false);
            }
            sprint = true;
        }
        this.cpsLimit = System.currentTimeMillis() + 550L;
        this.attackEntity(target);
        if (this.settings.get(4) && target.isBlocking()) {
            int slot = InventoryUtil.getAxe(true);
            if (slot == -1) {
                return;
            }
            AuraNew.mc.player.connection.sendPacket(new CHeldItemChangePacket(slot));
            this.attackEntity(target);
            AuraNew.mc.player.connection.sendPacket(new CHeldItemChangePacket(AuraNew.mc.player.inventory.currentItem));
            ClientUtil.sendMesage("\u0411\u0420\u042f\u041a: " + AuraNew.mc.player.ticksExisted);
        }
        if (sprint) {
            AuraNew.mc.player.connection.sendPacket(new CEntityActionPacket(AuraNew.mc.player, CEntityActionPacket.Action.START_SPRINTING));
        }
    }

    private boolean canAttack() {
        if (this.cpsLimit >= System.currentTimeMillis() || Managment.FUNCTION_MANAGER.autoPotionFunction.isActivePotion || this.getDistance(this.target) >= (double)this.range.getValue().floatValue() || AuraNew.mc.player.getCooledAttackStrength(1.0f) <= 0.93f) {
            return false;
        }
        if (AuraNew.mc.player.isInWater() && AuraNew.mc.player.areEyesInFluid(FluidTags.WATER) || AuraNew.mc.player.isInLava() || AuraNew.mc.player.isOnLadder() || AuraNew.mc.player.isRidingHorse() || AuraNew.mc.player.abilities.isFlying || AuraNew.mc.player.isElytraFlying() || AuraNew.mc.player.isPotionActive(Effects.LEVITATION) || AuraNew.mc.player.isPotionActive(Effects.SLOW_FALLING) || !this.settings.get(0)) {
            return true;
        }
        return this.space.get() && !AuraNew.mc.player.movementInput.jump || AuraNew.mc.player.fallDistance > 0.0f && !AuraNew.mc.player.isOnGround();
    }

    private LivingEntity findTarget() {
        ArrayList<LivingEntity> targets = new ArrayList<LivingEntity>();
        for (Entity entity : AuraNew.mc.world.getAllEntities()) {
            LivingEntity living;
            if (!(entity instanceof LivingEntity) || !this.isValid(living = (LivingEntity)entity)) continue;
            double d = this.getDistance(living);
            float f = this.range.getValue().floatValue();
            float f2 = this.mode.is("\u041e\u0431\u044b\u0447\u043d\u0430\u044f") ? this.preRange.getValue().floatValue() : 0.0f;
            if (!(d <= (double)(f + f2)) || this.ignore.get(0) && Managment.FRIEND_MANAGER.isFriend(living.getName().getString()) || this.ignore.get(1) && living.isInvisible() || (double)living.getHealth() < 0.01 || this.ignore.get(2) && living instanceof PlayerEntity && living.getTotalArmorValue() == 0 || this.ignore.get(3) && living instanceof PlayerEntity && !living.getUniqueID().equals(PlayerEntity.getOfflineUUID(living.getName().getString()))) continue;
            targets.add(living);
        }
        if (targets.isEmpty()) {
            return null;
        }
        if (targets.size() == 1) {
            return (LivingEntity)targets.get(0);
        }
        return Collections.min(targets, switch (this.sort.getIndex()) {
            case 0 -> Comparator.comparingDouble(this::getDistance);
            case 1 -> Comparator.comparingDouble(LivingEntity::getHealth);
            case 2 -> Comparator.comparingDouble(this::getDegree);
            default -> null;
        });
    }

    private boolean isValid(LivingEntity entity) {
        if (entity instanceof ArmorStandEntity || entity == AuraNew.mc.player) {
            return false;
        }
        if (entity instanceof PlayerEntity) {
            return this.targets.get(0);
        }
        if (entity instanceof AnimalEntity || entity instanceof VillagerEntity || entity instanceof WaterMobEntity) {
            return this.targets.get(1);
        }
        if (entity instanceof MonsterEntity || entity instanceof SlimeEntity) {
            return this.targets.get(2);
        }
        return true;
    }

    private void updateClientRotation(float yaw2, float pitch2) {
        AuraNew.mc.player.rotationYawHead = yaw2;
        AuraNew.mc.player.renderYawOffset = yaw2;
        AuraNew.mc.player.rotationPitchHead = pitch2;
    }

    private void reset() {
        this.rotYaw = AuraNew.mc.player.rotationYaw;
        this.rotPitch = AuraNew.mc.player.rotationPitch;
        this.target = null;
    }

    private void attackEntity(LivingEntity entity) {
        AuraNew.mc.playerController.attackEntity(AuraNew.mc.player, entity);
        AuraNew.mc.player.swingArm(Hand.MAIN_HAND);
    }

    private boolean isInHitBox(LivingEntity me, LivingEntity to) {
        double wHalf = to.getWidth() / 2.0f;
        double yExpand = MathHelper.clamp(me.getPosYEye() - to.getPosY(), 0.0, (double)to.getHeight());
        double xExpand = MathHelper.clamp(AuraNew.mc.player.getPosX() - to.getPosX(), -wHalf, wHalf);
        double zExpand = MathHelper.clamp(AuraNew.mc.player.getPosZ() - to.getPosZ(), -wHalf, wHalf);
        return new Vector3d(to.getPosX() - me.getPosX() + xExpand, to.getPosY() - me.getPosYEye() + yExpand, to.getPosZ() - me.getPosZ() + zExpand).length() == 0.0;
    }

    private Vector3d getVector3d(LivingEntity me, LivingEntity to) {
        double wHalf = to.getWidth() / 2.0f;
        double yExpand = MathHelper.clamp(me.getPosYEye() - to.getPosY(), 0.0, (double)(to.getHeight() * (AuraNew.mc.player.getDistance(to) / this.range.getValue().floatValue())));
        double xExpand = MathHelper.clamp(AuraNew.mc.player.getPosX() - to.getPosX(), -wHalf, wHalf);
        double zExpand = MathHelper.clamp(AuraNew.mc.player.getPosZ() - to.getPosZ(), -wHalf, wHalf);
        return new Vector3d(to.getPosX() - me.getPosX() + xExpand, to.getPosY() - me.getPosYEye() + yExpand, to.getPosZ() - me.getPosZ() + zExpand);
    }

    private double getDistance(LivingEntity entity) {
        return this.getVector3d(AuraNew.mc.player, entity).length();
    }

    private double getDegree(LivingEntity entity) {
        Vector3d vec = this.getVector3d(AuraNew.mc.player, entity);
        double yaw2 = MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(vec.z, vec.x)) - 90.0);
        double delta = MathHelper.wrapDegrees(yaw2 - (double)AuraNew.mc.player.rotationYaw);
        if (Math.abs(delta) > 180.0) {
            delta -= Math.signum(delta) * 360.0;
        }
        return Math.abs(delta);
    }

    private boolean isLookingAtMe(LivingEntity target) {
        double x = target.getPosX() - AuraNew.mc.player.getPosX();
        double z = target.getPosZ() - AuraNew.mc.player.getPosZ();
        float entityYaw = MathHelper.wrapDegrees(target.rotationYaw);
        double yaw2 = Math.toDegrees(Math.atan2(z, x)) + 90.0;
        return Math.abs(MathHelper.wrapDegrees(yaw2 - (double)entityYaw)) <= 90.0;
    }

    private void drawCircle(LivingEntity target, EventRender e) {
        int i;
        EntityRendererManager rm = mc.getRenderManager();
        double x = target.lastTickPosX + (target.getPosX() - target.lastTickPosX) * (double)e.partialTicks - rm.info.getProjectedView().getX();
        double y = target.lastTickPosY + (target.getPosY() - target.lastTickPosY) * (double)e.partialTicks - rm.info.getProjectedView().getY();
        double z = target.lastTickPosZ + (target.getPosZ() - target.lastTickPosZ) * (double)e.partialTicks - rm.info.getProjectedView().getZ();
        float height2 = target.getHeight();
        double duration = 2000.0;
        double elapsed = (double)System.currentTimeMillis() % duration;
        boolean side = elapsed > duration / 2.0;
        double progress = elapsed / (duration / 2.0);
        progress = side ? (progress -= 1.0) : 1.0 - progress;
        progress = progress < 0.5 ? 2.0 * progress * progress : 1.0 - Math.pow(-2.0 * progress + 2.0, 2.0) / 2.0;
        double eased = (double)(height2 / 2.0f) * (progress > 0.5 ? 1.0 - progress : progress) * (double)(side ? -1 : 1);
        RenderSystem.pushMatrix();
        GL11.glDepthMask((boolean)false);
        GL11.glEnable((int)2848);
        GL11.glHint((int)3154, (int)4354);
        RenderSystem.disableTexture();
        RenderSystem.enableBlend();
        RenderSystem.disableAlphaTest();
        RenderSystem.shadeModel(7425);
        RenderSystem.disableCull();
        RenderSystem.lineWidth(1.5f);
        RenderSystem.color4f(-1.0f, -1.0f, -1.0f, -1.0f);
        buffer.begin(8, DefaultVertexFormats.POSITION_COLOR);
        float[] colors = null;
        for (i = 0; i <= 360; ++i) {
            colors = RenderUtil.IntColor.rgb(Managment.STYLE_MANAGER.getCurrentStyle().getColor(i));
            buffer.pos(x + Math.cos(Math.toRadians(i)) * (double)target.getWidth() * 0.8, y + (double)height2 * progress, z + Math.sin(Math.toRadians(i)) * (double)target.getWidth() * 0.8).color(colors[0], colors[1], colors[2], 0.5f).endVertex();
            buffer.pos(x + Math.cos(Math.toRadians(i)) * (double)target.getWidth() * 0.8, y + (double)height2 * progress + eased, z + Math.sin(Math.toRadians(i)) * (double)target.getWidth() * 0.8).color(colors[0], colors[1], colors[2], 0.0f).endVertex();
        }
        buffer.finishDrawing();
        WorldVertexBufferUploader.draw(buffer);
        RenderSystem.color4f(-1.0f, -1.0f, -1.0f, -1.0f);
        buffer.begin(2, DefaultVertexFormats.POSITION_COLOR);
        for (i = 0; i <= 360; ++i) {
            buffer.pos(x + Math.cos(Math.toRadians(i)) * (double)target.getWidth() * 0.8, y + (double)height2 * progress, z + Math.sin(Math.toRadians(i)) * (double)target.getWidth() * 0.8).color(colors[0], colors[1], colors[2], 0.5f).endVertex();
        }
        buffer.finishDrawing();
        WorldVertexBufferUploader.draw(buffer);
        RenderSystem.enableCull();
        RenderSystem.disableBlend();
        RenderSystem.enableTexture();
        RenderSystem.enableAlphaTest();
        GL11.glDepthMask((boolean)true);
        GL11.glDisable((int)2848);
        GL11.glHint((int)3154, (int)4354);
        RenderSystem.shadeModel(7424);
        RenderSystem.popMatrix();
    }

    @Override
    protected void onDisable() {
        super.onDisable();
        this.reset();
    }

    @Override
    protected void onEnable() {
        super.onEnable();
        this.reset();
    }

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

    public float getRotYaw() {
        return this.rotYaw;
    }

    public float getRotPitch() {
        return this.rotPitch;
    }
}
 
Начинающий
Статус
Оффлайн
Регистрация
23 Апр 2024
Сообщения
388
Реакции[?]
0
Поинты[?]
1K
Начинающий
Статус
Оффлайн
Регистрация
26 Окт 2024
Сообщения
19
Реакции[?]
0
Поинты[?]
0
Сверху Снизу