Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Часть функционала Assistant LonyGrief | EvaWare V3

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
26 Янв 2025
Сообщения
12
Реакции
1
Выберите загрузчик игры
  1. Fabric
Короче решил слить для вас ассистант для лунигрифа.

1. Auto-pvp (Автоматически ищет игроков с префиксами которые вы выбрали в настройке)
Например: Вы выбрали префикс игрока, но в пвп решил зайти кастомка, а потом игрок, кастомку скипаем и принимаем онли игрока.
2. Auto-Player (Автоматически делает для вас GPS с ником игрока и координатами)
Например: Вы прописали /rtp near, ассистант понял что нужно быстро вставить GPS до него и при телепорте у вас сразу есть GPS)
3. Livalka (ну думаю всем понятно) - Я не стал добавлять магма ливку, она бессмысленна.


Пожалуйста, авторизуйтесь для просмотра ссылки.


fixed GPS:
1770204258581.png



code:
AssistantModule:
Expand Collapse Copy
package sweetie.evaware.client.features.modules.player;

import lombok.Getter;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.network.packet.s2c.play.GameMessageS2CPacket;
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
import net.minecraft.screen.GenericContainerScreenHandler;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.text.Text;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import org.joml.Vector2f;
import org.joml.Vector2i;
import sweetie.evaware.api.event.EventListener;
import sweetie.evaware.api.event.Listener;
import sweetie.evaware.api.event.events.client.PacketEvent;
import sweetie.evaware.api.event.events.client.TickEvent;
import sweetie.evaware.api.event.events.render.Render2DEvent;
import sweetie.evaware.api.module.Category;
import sweetie.evaware.api.module.Module;
import sweetie.evaware.api.module.ModuleRegister;
import sweetie.evaware.api.module.setting.BindSetting;
import sweetie.evaware.api.module.setting.BooleanSetting;
import sweetie.evaware.api.module.setting.ModeSetting;
import sweetie.evaware.api.module.setting.MultiBooleanSetting;
import sweetie.evaware.api.system.backend.Pair;
import sweetie.evaware.api.system.client.GpsManager;
import sweetie.evaware.api.utils.color.UIColors;
import sweetie.evaware.api.utils.math.MathUtil;
import sweetie.evaware.api.utils.math.ProjectionUtil;
import sweetie.evaware.api.utils.player.InventoryUtil;
import sweetie.evaware.api.utils.render.RenderUtil;
import sweetie.evaware.api.utils.render.fonts.Fonts;

import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

@ModuleRegister(name = "Assistant", category = Category.PLAYER)
public class AssistantModule extends Module {
    @Getter private static final AssistantModule instance = new AssistantModule();

    public enum Mode {
        FUNTIME, HOLYWORLD, LONYGRIEF;
    }

    private final Supplier<Boolean> isHotkeysEnabled = () -> getFunctions().isEnabled("Hotkeys");
    private final Supplier<Boolean> isHWKeys = () -> isHotkeysEnabled.get() && getMode().is("Holy World");
    private final Supplier<Boolean> isFTKeys = () -> isHotkeysEnabled.get() && getMode().is("Fun Time");
    private final Supplier<Boolean> isLGKeys = () -> isHotkeysEnabled.get() && getMode().is("Lony Grief");

    private Mode currentMode = Mode.FUNTIME;
    private String targetRival = null;

    @Getter private final MultiBooleanSetting functions = new MultiBooleanSetting("Functions").value(
            new BooleanSetting("Hotkeys").value(true),
            new BooleanSetting("Timers").value(false)
    );
    public final BooleanSetting autoPvpLony = new BooleanSetting("Auto-PvP").value(true).setVisible(isLGKeys);

    @Getter private final MultiBooleanSetting lonyPrefixes = new MultiBooleanSetting("Prefixes").value(
            new BooleanSetting("Player").value(true),
            new BooleanSetting("Legenda").value(true),
            new BooleanSetting("Pravitel").value(true),
            new BooleanSetting("Povelitel").value(true),
            new BooleanSetting("D.Admin").value(true),
            new BooleanSetting("Staff").value(false),
            new BooleanSetting("Eternity").value(true),
            new BooleanSetting("Luxe").value(true)
    ).setVisible(() -> isLGKeys.get() && autoPvpLony.getValue());

    @Getter private final ModeSetting mode = new ModeSetting("Mode").value("Fun Time")
            .values("Fun Time", "Holy World", "Lony Grief").setVisible(isHotkeysEnabled)
            .onAction(() -> {
                currentMode = switch (getMode().getValue()) {
                    case "Fun Time" -> Mode.FUNTIME;
                    case "Lony Grief" -> Mode.LONYGRIEF;
                    default -> Mode.HOLYWORLD;
                };
            });

    private final BooleanSetting legit = new BooleanSetting("Legit").value(true).setVisible(isHotkeysEnabled);
    public final BooleanSetting autoPlayerLony = new BooleanSetting("Auto-Player").value(true).setVisible(isLGKeys);

    private final Map<InventoryUtil.ItemUsage, Pair<BindSetting, Mode>> keyBindings = new LinkedHashMap<>();
    private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
    private final List<Pair<Long, Vec3d>> consumables = new ArrayList<>();
    private final Map<Vec3d, String> consumableNames = new HashMap<>();

    public AssistantModule() {
        // --- FUNTIME ---
        keyBindings.put(new InventoryUtil.ItemUsage(Items.ENDER_EYE, this), new Pair<>(new BindSetting("Disorientation").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.NETHERITE_SCRAP, this), new Pair<>(new BindSetting("Trap").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.SUGAR, this), new Pair<>(new BindSetting("Clear dust").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.FIRE_CHARGE, this), new Pair<>(new BindSetting("Fire whirl").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.DRIED_KELP, this), new Pair<>(new BindSetting("Plast").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.PHANTOM_MEMBRANE, this), new Pair<>(new BindSetting("Divine aura").value(-999), Mode.FUNTIME));

        // --- HOLYWORLD ---
        keyBindings.put(new InventoryUtil.ItemUsage(Items.PRISMARINE_SHARD, this), new Pair<>(new BindSetting("Explosive trap").value(-999), Mode.HOLYWORLD));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.POPPED_CHORUS_FRUIT, this), new Pair<>(new BindSetting("Default trap").value(-999), Mode.HOLYWORLD));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.NETHER_STAR, this), new Pair<>(new BindSetting("Stun").value(-999), Mode.HOLYWORLD));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.FIRE_CHARGE, this), new Pair<>(new BindSetting("Explosive thing").value(-999), Mode.HOLYWORLD));

        keyBindings.put(new InventoryUtil.ItemUsage(Items.CLAY_BALL, this), new Pair<>(new BindSetting("Ливалочка").value(-999), Mode.LONYGRIEF));

        addSettings(functions, mode, lonyPrefixes, legit, autoPvpLony, autoPlayerLony);

        keyBindings.forEach((key, value) -> {
            if (value.right() == Mode.HOLYWORLD) value.left().setVisible(isHWKeys);
            if (value.right() == Mode.FUNTIME) value.left().setVisible(isFTKeys);
            if (value.right() == Mode.LONYGRIEF) value.left().setVisible(isLGKeys);
            addSettings(value.left());
        });
    }

    @Override
    public void onEvent() {
        EventListener tickEvent = TickEvent.getInstance().subscribe(new Listener<>(event -> handleTickEvent()));
        EventListener renderEvent = Render2DEvent.getInstance().subscribe(new Listener<>(this::handleRenderEvent));
        EventListener packetEvent = PacketEvent.getInstance().subscribe(new Listener<>(this::handlePacketEvent));
        addEvents(tickEvent, renderEvent, packetEvent);
    }

    private void handlePacketEvent(PacketEvent.PacketEventData event) {
        if (event.isSend() || mc.world == null) return;

        if (event.packet() instanceof PlaySoundS2CPacket soundPacket) {
            handleSoundPackets(soundPacket);
        }

        if (autoPvpLony.getValue() && currentMode == Mode.LONYGRIEF && event.packet() instanceof GameMessageS2CPacket chatPacket) {
            String rawMsg = chatPacket.content().getString();
            String cleanMsg = rawMsg.replaceAll("(?i)§[0-9a-fklmnor]", " ")
                    .replace("›", " ")
                    .replace(">", " ")
                    .trim();

            Pattern pvpPattern = Pattern.compile("Игрок\\s+([a-zA-Z0-9_]{3,16})\\s+ищет", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
            Matcher pvpMatcher = pvpPattern.matcher(cleanMsg);

            if (pvpMatcher.find()) {
                String nickname = pvpMatcher.group(1);
                if (nickname.equalsIgnoreCase(mc.player.getName().getString())) return;

                String rawPrefix = getPlayerRankFromTab(nickname);
                if (shouldClickPvp(rawPrefix)) {
                    this.targetRival = nickname;
                }
            }

            if (autoPlayerLony.getValue()) {
                Pattern pattern = Pattern.compile("(?:игроком|игрок)\\s+([^\\s!]+).+?(?:координаты|Кординаты|X):?\\s*(-?\\d+)[^\\d-]+-?\\d+[^\\d-]+(-?\\d+)", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
                Matcher matcher = pattern.matcher(cleanMsg);
                if (matcher.find()) {
                    String name = matcher.group(1);
                    try {
                        int x = Integer.parseInt(matcher.group(2));
                        int z = Integer.parseInt(matcher.group(3));
                        GpsManager.getInstance().setGps(new Vector2i(x, z), name);
                    } catch (NumberFormatException ignored) {}
                }
            }
        }
    }

    private void handleAutoPvPLogic() {
        if (targetRival == null || !(mc.player.currentScreenHandler instanceof GenericContainerScreenHandler handler)) return;

        for (int i = 0; i < handler.slots.size(); i++) {
            ItemStack stack = handler.getSlot(i).getStack();
            if (!stack.isEmpty() && stack.isOf(Items.TOTEM_OF_UNDYING)) {
                mc.interactionManager.clickSlot(handler.syncId, i, 0, SlotActionType.PICKUP, mc.player);
                targetRival = null;
                return;
            }
        }
    }

    private String getPlayerRankFromTab(String name) {
        if (mc.getNetworkHandler() == null) return "";

        for (var entry : mc.getNetworkHandler().getPlayerList()) {
            if (entry.getProfile().getName().equalsIgnoreCase(name)) {
                StringBuilder fullText = new StringBuilder();
                var team = entry.getScoreboardTeam();

                if (team != null) fullText.append(team.getPrefix().getString());
                if (entry.getDisplayName() != null) fullText.append(entry.getDisplayName().getString());

                return fullText.toString().replaceAll("(?i)§[0-9a-fklmnor]", "");
            }
        }
        return "";
    }

    private boolean shouldClickPvp(String text) {
        if (text == null || text.isEmpty()) return false;
        String upper = text.toUpperCase();

        // Проверяем каждую галочку в MultiBooleanSetting по отдельности
        if (lonyPrefixes.isEnabled("Player") && (upper.contains("PLAYER") || text.contains("ᴘʟᴀʏᴇʀ"))) return true;
        if (lonyPrefixes.isEnabled("Legenda") && (upper.contains("LEGENDA") || text.contains("ʟᴇɢᴇɴᴅᴀ"))) return true;
        if (lonyPrefixes.isEnabled("Pravitel") && (upper.contains("PRAVITEL") || text.contains("ᴘʀᴀᴠɪᴛᴇʟ"))) return true;
        if (lonyPrefixes.isEnabled("Povelitel") && (upper.contains("POVELITEL") || text.contains("ᴘᴏᴠᴇʟɪᴛᴇʟ"))) return true;
        if (lonyPrefixes.isEnabled("D.Admin") && (upper.contains("DADMIN") || text.contains("ᴅᴀᴅᴍɪɴ"))) return true;
        if (lonyPrefixes.isEnabled("Staff") && (upper.contains("STAFF") || upper.contains("ADMIN") || text.contains("sᴛᴀꜰꜰ"))) return true;
        if (lonyPrefixes.isEnabled("Eternity") && (upper.contains("ETERNITY") || text.contains("ᴇᴛᴇʀɴɪᴛʏ"))) return true;
        if (lonyPrefixes.isEnabled("Luxe") && (upper.contains("LUXE") || text.contains("ʟᴜxᴇ"))) return true;

        return false;
    }

    private void handleTickEvent() {
        if (mc.player == null) return;

        if (autoPvpLony.getValue() && currentMode == Mode.LONYGRIEF) {
            handleAutoPvPLogic();
        }

        if (!isHotkeysEnabled.get() || mc.currentScreen != null) return;

        keyBindings.forEach((usage, pair) -> {
            if (pair.right() == currentMode) {
                usage.handleUse(pair.left().getValue(), legit.getValue());
            }
        });
    }

    private void handleSoundPackets(PlaySoundS2CPacket soundPacket) {
        String soundPath = soundPacket.getSound().getIdAsString();
        if (soundPath.equals("minecraft:block.piston.contract")) {
            Vec3d pos = Vec3d.ofCenter(new BlockPos((int) soundPacket.getX(), (int) soundPacket.getY(), (int) soundPacket.getZ()));
            consumables.add(new Pair<>(System.currentTimeMillis() + 15000, pos));
            consumableNames.put(pos, "Trap");
        } else if (soundPath.equals("minecraft:block.anvil.place")) {
            handleAnvilLogic(soundPacket);
        }
    }

    private void handleAnvilLogic(PlaySoundS2CPacket soundPacket) {
        BlockPos soundPos = new BlockPos((int) soundPacket.getX(), (int) soundPacket.getY(), (int) soundPacket.getZ());
        scheduler.schedule(() -> getCube(soundPos, 4, 4).stream()
                .filter(pos -> getDistance(soundPos, pos) > 2 && mc.world.getBlockState(pos).getBlock() == Blocks.COBBLESTONE)
                .min(Comparator.comparing(pos -> getDistance(soundPos, pos))).ifPresent(pos -> {
                    if (getCube(pos, 1, 1).stream().anyMatch(p -> mc.world.getBlockState(p).getBlock() == Blocks.ANVIL)) return;
                    long solidCount = getCube(pos, 1, 1).stream().filter(p -> {
                        BlockState s = mc.world.getBlockState(p); return !s.isAir() && s.isSolidBlock(mc.world, p);
                    }).count();
                    if (solidCount == 18 || solidCount == 15 || solidCount == 5) {
                        int time = (solidCount == 18 || solidCount == 15) ? 20000 : 15000;
                        Vec3d addPos = Vec3d.ofCenter(pos).add(0, solidCount == 5 ? -1.5 : 0, 0);
                        consumables.add(new Pair<>(System.currentTimeMillis() + time - 250, addPos));
                        consumableNames.put(addPos, (solidCount == 18 || solidCount == 15) ? "Plast" : "Trap");
                    }
                }), 250, TimeUnit.MILLISECONDS);
    }

    private void handleRenderEvent(Render2DEvent.Render2DEventData event) {
        if (!functions.isEnabled("Timers")) return;
        MatrixStack matrixStack = event.matrixStack();
        consumables.removeIf(cons -> (double) (cons.left() - System.currentTimeMillis()) <= 0);
        for (Pair<Long, Vec3d> cons : consumables) {
            Vector2f screenPos = ProjectionUtil.project(cons.right());
            if (screenPos.x == Float.MAX_VALUE || screenPos.y == Float.MAX_VALUE) continue;
            double time = MathUtil.round((double) (cons.left() - System.currentTimeMillis()) / 1000, 1);
            String text = consumableNames.getOrDefault(cons.right(), "Timer") + ": " + time + "s";
            float textWidth = Fonts.PS_BOLD.getWidth(text, 7f);
            RenderUtil.BLUR_RECT.draw(matrixStack, screenPos.x - textWidth / 2f, screenPos.y, textWidth + 6f, 10f, 2f, UIColors.blur());
            Fonts.PS_BOLD.drawText(matrixStack, text, screenPos.x - textWidth / 2f + 3f, screenPos.y + 3f, 7f, UIColors.textColor());
        }
    }

    private double getDistance(BlockPos pos1, BlockPos pos2) {
        return Math.sqrt(pos1.getSquaredDistance(pos2));
    }

    private List<BlockPos> getCube(BlockPos center, int xRadius, int yRadius) {
        List<BlockPos> sphere = new ArrayList<>();
        for (int x = -xRadius; x <= xRadius; x++) {
            for (int y = -yRadius; y <= yRadius; y++) {
                for (int z = -xRadius; z <= xRadius; z++) {
                    sphere.add(center.add(x, y, z));
                }
            }
        }
        return sphere;
    }
}

фикс для gpsManager:
GpsManager:
Expand Collapse Copy
public class GpsManager implements QuickImports {
    @Getter private static final GpsManager instance = new GpsManager();

    private Vector2i gpsPosition = null;
    private Vector2i lastGpsPosition = null;
    private String targetLabel = null;

    private final AnimationUtil distanceAnimation = new AnimationUtil();
    private final AnimationUtil switchAnimation = new AnimationUtil();

    public void setGps(Vector2i pos, String label) {
        this.gpsPosition = pos;
        this.targetLabel = label;
    }

    public void update(DrawContext context) {
        if (gpsPosition != null) {
            lastGpsPosition = gpsPosition;
        }

        if (context == null) return;

        float scale = RenderService.getInstance().getScale();

        boolean noGps = gpsPosition == null;
        boolean noLastGps = lastGpsPosition == null;
        float distance = !noLastGps ? getDistance(lastGpsPosition) : getDistance(new Vector2i(0, 0));
        float maxDistance = 10f;
        float minDistance = 3f;

        distanceAnimation.update();
        switchAnimation.update();

        distanceAnimation.run(distance <= minDistance ? 0.0 : distance >= maxDistance ? 1.0 : (distance - minDistance) / (maxDistance - minDistance), 500, Easing.EXPO_OUT);
        switchAnimation.run(noGps ? 0.0 : 1.0, 500, Easing.EXPO_OUT);

        if (distanceAnimation.getValue() < 0.1 || switchAnimation.getValue() < 0.1) return;

        float switchAnim = (float) switchAnimation.getValue();
        double combinedAnim = distanceAnimation.getValue() * switchAnim;

        float x = mc.getWindow().getScaledWidth() / 2f;
        float y = mc.getWindow().getScaledHeight() / 6f;

        float targetX = noGps ? 0f : (float) lastGpsPosition.x;
        float targetY = noGps ? 0f : (float) lastGpsPosition.y;
        float rotation = getRotations(new Vec2f(targetX, targetY)) - mc.player.getYaw();

        float arrowHeight = 12f * scale;

        context.getMatrices().push();
        context.getMatrices().translate(x, y, 0.0f);
        context.getMatrices().multiply(RotationAxis.POSITIVE_Z.rotationDegrees(rotation));
        context.getMatrices().translate(-x, -y, 0.0f);
        PointersModule.getInstance().drawPointer(context, x, y - arrowHeight * 1.75f, 30f * scale, ColorUtil.setAlpha(UIColors.gradient((int) combinedAnim), (int) (255 * combinedAnim)), true);
        RenderUtil.OTHER.scaleStop(context.getMatrices());

        float textY = (y + arrowHeight * (2f - switchAnim));

        Fonts.PS_BOLD.drawCenteredText(context.getMatrices(), String.format("%.1f", distance) + "m", x, textY, 8f * scale, UIColors.textColor((int) (255 * combinedAnim)));

        if (targetLabel != null && !noGps) {
            Fonts.PS_BOLD.drawCenteredText(context.getMatrices(), targetLabel, x, textY + (10f * scale), 7f * scale, UIColors.textColor((int) (255 * combinedAnim)));
        }
    }
 
// --- FUNTIME --- keyBindings.put(new InventoryUtil.ItemUsage(Items.ENDER_EYE, this), new Pair<>(new BindSetting("Disorientation").value(-999), Mode.FUNTIME)); keyBindings.put(new InventoryUtil.ItemUsage(Items.NETHERITE_SCRAP, this), new Pair<>(new BindSetting("Trap").value(-999), Mode.FUNTIME)); keyBindings.put(new InventoryUtil.ItemUsage(Items.SUGAR, this), new Pair<>(new BindSetting("Clear dust").value(-999), Mode.FUNTIME)); keyBindings.put(new InventoryUtil.ItemUsage(Items.FIRE_CHARGE, this), new Pair<>(new BindSetting("Fire whirl").value(-999), Mode.FUNTIME)); keyBindings.put(new InventoryUtil.ItemUsage(Items.DRIED_KELP, this), new Pair<>(new BindSetting("Plast").value(-999), Mode.FUNTIME)); keyBindings.put(new InventoryUtil.ItemUsage(Items.PHANTOM_MEMBRANE, this), new Pair<>(new BindSetting("Divine aura").value(-999), Mode.FUNTIME));
... пиздец
 
Короче решил слить для вас ассистант для лунигрифа.

1. Auto-pvp (Автоматически ищет игроков с префиксами которые вы выбрали в настройке)
Например: Вы выбрали префикс игрока, но в пвп решил зайти кастомка, а потом игрок, кастомку скипаем и принимаем онли игрока.
2. Auto-Player (Автоматически делает для вас GPS с ником игрока и координатами)
Например: Вы прописали /rtp near, ассистант понял что нужно быстро вставить GPS до него и при телепорте у вас сразу есть GPS)
3. Livalka (ну думаю всем понятно) - Я не стал добавлять магма ливку, она бессмысленна.


Пожалуйста, авторизуйтесь для просмотра ссылки.


fixed GPS:
Посмотреть вложение 326598


code:
AssistantModule:
Expand Collapse Copy
package sweetie.evaware.client.features.modules.player;

import lombok.Getter;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.network.packet.s2c.play.GameMessageS2CPacket;
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
import net.minecraft.screen.GenericContainerScreenHandler;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.text.Text;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import org.joml.Vector2f;
import org.joml.Vector2i;
import sweetie.evaware.api.event.EventListener;
import sweetie.evaware.api.event.Listener;
import sweetie.evaware.api.event.events.client.PacketEvent;
import sweetie.evaware.api.event.events.client.TickEvent;
import sweetie.evaware.api.event.events.render.Render2DEvent;
import sweetie.evaware.api.module.Category;
import sweetie.evaware.api.module.Module;
import sweetie.evaware.api.module.ModuleRegister;
import sweetie.evaware.api.module.setting.BindSetting;
import sweetie.evaware.api.module.setting.BooleanSetting;
import sweetie.evaware.api.module.setting.ModeSetting;
import sweetie.evaware.api.module.setting.MultiBooleanSetting;
import sweetie.evaware.api.system.backend.Pair;
import sweetie.evaware.api.system.client.GpsManager;
import sweetie.evaware.api.utils.color.UIColors;
import sweetie.evaware.api.utils.math.MathUtil;
import sweetie.evaware.api.utils.math.ProjectionUtil;
import sweetie.evaware.api.utils.player.InventoryUtil;
import sweetie.evaware.api.utils.render.RenderUtil;
import sweetie.evaware.api.utils.render.fonts.Fonts;

import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

@ModuleRegister(name = "Assistant", category = Category.PLAYER)
public class AssistantModule extends Module {
    @Getter private static final AssistantModule instance = new AssistantModule();

    public enum Mode {
        FUNTIME, HOLYWORLD, LONYGRIEF;
    }

    private final Supplier<Boolean> isHotkeysEnabled = () -> getFunctions().isEnabled("Hotkeys");
    private final Supplier<Boolean> isHWKeys = () -> isHotkeysEnabled.get() && getMode().is("Holy World");
    private final Supplier<Boolean> isFTKeys = () -> isHotkeysEnabled.get() && getMode().is("Fun Time");
    private final Supplier<Boolean> isLGKeys = () -> isHotkeysEnabled.get() && getMode().is("Lony Grief");

    private Mode currentMode = Mode.FUNTIME;
    private String targetRival = null;

    @Getter private final MultiBooleanSetting functions = new MultiBooleanSetting("Functions").value(
            new BooleanSetting("Hotkeys").value(true),
            new BooleanSetting("Timers").value(false)
    );
    public final BooleanSetting autoPvpLony = new BooleanSetting("Auto-PvP").value(true).setVisible(isLGKeys);

    @Getter private final MultiBooleanSetting lonyPrefixes = new MultiBooleanSetting("Prefixes").value(
            new BooleanSetting("Player").value(true),
            new BooleanSetting("Legenda").value(true),
            new BooleanSetting("Pravitel").value(true),
            new BooleanSetting("Povelitel").value(true),
            new BooleanSetting("D.Admin").value(true),
            new BooleanSetting("Staff").value(false),
            new BooleanSetting("Eternity").value(true),
            new BooleanSetting("Luxe").value(true)
    ).setVisible(() -> isLGKeys.get() && autoPvpLony.getValue());

    @Getter private final ModeSetting mode = new ModeSetting("Mode").value("Fun Time")
            .values("Fun Time", "Holy World", "Lony Grief").setVisible(isHotkeysEnabled)
            .onAction(() -> {
                currentMode = switch (getMode().getValue()) {
                    case "Fun Time" -> Mode.FUNTIME;
                    case "Lony Grief" -> Mode.LONYGRIEF;
                    default -> Mode.HOLYWORLD;
                };
            });

    private final BooleanSetting legit = new BooleanSetting("Legit").value(true).setVisible(isHotkeysEnabled);
    public final BooleanSetting autoPlayerLony = new BooleanSetting("Auto-Player").value(true).setVisible(isLGKeys);

    private final Map<InventoryUtil.ItemUsage, Pair<BindSetting, Mode>> keyBindings = new LinkedHashMap<>();
    private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
    private final List<Pair<Long, Vec3d>> consumables = new ArrayList<>();
    private final Map<Vec3d, String> consumableNames = new HashMap<>();

    public AssistantModule() {
        // --- FUNTIME ---
        keyBindings.put(new InventoryUtil.ItemUsage(Items.ENDER_EYE, this), new Pair<>(new BindSetting("Disorientation").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.NETHERITE_SCRAP, this), new Pair<>(new BindSetting("Trap").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.SUGAR, this), new Pair<>(new BindSetting("Clear dust").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.FIRE_CHARGE, this), new Pair<>(new BindSetting("Fire whirl").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.DRIED_KELP, this), new Pair<>(new BindSetting("Plast").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.PHANTOM_MEMBRANE, this), new Pair<>(new BindSetting("Divine aura").value(-999), Mode.FUNTIME));

        // --- HOLYWORLD ---
        keyBindings.put(new InventoryUtil.ItemUsage(Items.PRISMARINE_SHARD, this), new Pair<>(new BindSetting("Explosive trap").value(-999), Mode.HOLYWORLD));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.POPPED_CHORUS_FRUIT, this), new Pair<>(new BindSetting("Default trap").value(-999), Mode.HOLYWORLD));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.NETHER_STAR, this), new Pair<>(new BindSetting("Stun").value(-999), Mode.HOLYWORLD));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.FIRE_CHARGE, this), new Pair<>(new BindSetting("Explosive thing").value(-999), Mode.HOLYWORLD));

        keyBindings.put(new InventoryUtil.ItemUsage(Items.CLAY_BALL, this), new Pair<>(new BindSetting("Ливалочка").value(-999), Mode.LONYGRIEF));

        addSettings(functions, mode, lonyPrefixes, legit, autoPvpLony, autoPlayerLony);

        keyBindings.forEach((key, value) -> {
            if (value.right() == Mode.HOLYWORLD) value.left().setVisible(isHWKeys);
            if (value.right() == Mode.FUNTIME) value.left().setVisible(isFTKeys);
            if (value.right() == Mode.LONYGRIEF) value.left().setVisible(isLGKeys);
            addSettings(value.left());
        });
    }

    @Override
    public void onEvent() {
        EventListener tickEvent = TickEvent.getInstance().subscribe(new Listener<>(event -> handleTickEvent()));
        EventListener renderEvent = Render2DEvent.getInstance().subscribe(new Listener<>(this::handleRenderEvent));
        EventListener packetEvent = PacketEvent.getInstance().subscribe(new Listener<>(this::handlePacketEvent));
        addEvents(tickEvent, renderEvent, packetEvent);
    }

    private void handlePacketEvent(PacketEvent.PacketEventData event) {
        if (event.isSend() || mc.world == null) return;

        if (event.packet() instanceof PlaySoundS2CPacket soundPacket) {
            handleSoundPackets(soundPacket);
        }

        if (autoPvpLony.getValue() && currentMode == Mode.LONYGRIEF && event.packet() instanceof GameMessageS2CPacket chatPacket) {
            String rawMsg = chatPacket.content().getString();
            String cleanMsg = rawMsg.replaceAll("(?i)§[0-9a-fklmnor]", " ")
                    .replace("›", " ")
                    .replace(">", " ")
                    .trim();

            Pattern pvpPattern = Pattern.compile("Игрок\\s+([a-zA-Z0-9_]{3,16})\\s+ищет", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
            Matcher pvpMatcher = pvpPattern.matcher(cleanMsg);

            if (pvpMatcher.find()) {
                String nickname = pvpMatcher.group(1);
                if (nickname.equalsIgnoreCase(mc.player.getName().getString())) return;

                String rawPrefix = getPlayerRankFromTab(nickname);
                if (shouldClickPvp(rawPrefix)) {
                    this.targetRival = nickname;
                }
            }

            if (autoPlayerLony.getValue()) {
                Pattern pattern = Pattern.compile("(?:игроком|игрок)\\s+([^\\s!]+).+?(?:координаты|Кординаты|X):?\\s*(-?\\d+)[^\\d-]+-?\\d+[^\\d-]+(-?\\d+)", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
                Matcher matcher = pattern.matcher(cleanMsg);
                if (matcher.find()) {
                    String name = matcher.group(1);
                    try {
                        int x = Integer.parseInt(matcher.group(2));
                        int z = Integer.parseInt(matcher.group(3));
                        GpsManager.getInstance().setGps(new Vector2i(x, z), name);
                    } catch (NumberFormatException ignored) {}
                }
            }
        }
    }

    private void handleAutoPvPLogic() {
        if (targetRival == null || !(mc.player.currentScreenHandler instanceof GenericContainerScreenHandler handler)) return;

        for (int i = 0; i < handler.slots.size(); i++) {
            ItemStack stack = handler.getSlot(i).getStack();
            if (!stack.isEmpty() && stack.isOf(Items.TOTEM_OF_UNDYING)) {
                mc.interactionManager.clickSlot(handler.syncId, i, 0, SlotActionType.PICKUP, mc.player);
                targetRival = null;
                return;
            }
        }
    }

    private String getPlayerRankFromTab(String name) {
        if (mc.getNetworkHandler() == null) return "";

        for (var entry : mc.getNetworkHandler().getPlayerList()) {
            if (entry.getProfile().getName().equalsIgnoreCase(name)) {
                StringBuilder fullText = new StringBuilder();
                var team = entry.getScoreboardTeam();

                if (team != null) fullText.append(team.getPrefix().getString());
                if (entry.getDisplayName() != null) fullText.append(entry.getDisplayName().getString());

                return fullText.toString().replaceAll("(?i)§[0-9a-fklmnor]", "");
            }
        }
        return "";
    }

    private boolean shouldClickPvp(String text) {
        if (text == null || text.isEmpty()) return false;
        String upper = text.toUpperCase();

        // Проверяем каждую галочку в MultiBooleanSetting по отдельности
        if (lonyPrefixes.isEnabled("Player") && (upper.contains("PLAYER") || text.contains("ᴘʟᴀʏᴇʀ"))) return true;
        if (lonyPrefixes.isEnabled("Legenda") && (upper.contains("LEGENDA") || text.contains("ʟᴇɢᴇɴᴅᴀ"))) return true;
        if (lonyPrefixes.isEnabled("Pravitel") && (upper.contains("PRAVITEL") || text.contains("ᴘʀᴀᴠɪᴛᴇʟ"))) return true;
        if (lonyPrefixes.isEnabled("Povelitel") && (upper.contains("POVELITEL") || text.contains("ᴘᴏᴠᴇʟɪᴛᴇʟ"))) return true;
        if (lonyPrefixes.isEnabled("D.Admin") && (upper.contains("DADMIN") || text.contains("ᴅᴀᴅᴍɪɴ"))) return true;
        if (lonyPrefixes.isEnabled("Staff") && (upper.contains("STAFF") || upper.contains("ADMIN") || text.contains("sᴛᴀꜰꜰ"))) return true;
        if (lonyPrefixes.isEnabled("Eternity") && (upper.contains("ETERNITY") || text.contains("ᴇᴛᴇʀɴɪᴛʏ"))) return true;
        if (lonyPrefixes.isEnabled("Luxe") && (upper.contains("LUXE") || text.contains("ʟᴜxᴇ"))) return true;

        return false;
    }

    private void handleTickEvent() {
        if (mc.player == null) return;

        if (autoPvpLony.getValue() && currentMode == Mode.LONYGRIEF) {
            handleAutoPvPLogic();
        }

        if (!isHotkeysEnabled.get() || mc.currentScreen != null) return;

        keyBindings.forEach((usage, pair) -> {
            if (pair.right() == currentMode) {
                usage.handleUse(pair.left().getValue(), legit.getValue());
            }
        });
    }

    private void handleSoundPackets(PlaySoundS2CPacket soundPacket) {
        String soundPath = soundPacket.getSound().getIdAsString();
        if (soundPath.equals("minecraft:block.piston.contract")) {
            Vec3d pos = Vec3d.ofCenter(new BlockPos((int) soundPacket.getX(), (int) soundPacket.getY(), (int) soundPacket.getZ()));
            consumables.add(new Pair<>(System.currentTimeMillis() + 15000, pos));
            consumableNames.put(pos, "Trap");
        } else if (soundPath.equals("minecraft:block.anvil.place")) {
            handleAnvilLogic(soundPacket);
        }
    }

    private void handleAnvilLogic(PlaySoundS2CPacket soundPacket) {
        BlockPos soundPos = new BlockPos((int) soundPacket.getX(), (int) soundPacket.getY(), (int) soundPacket.getZ());
        scheduler.schedule(() -> getCube(soundPos, 4, 4).stream()
                .filter(pos -> getDistance(soundPos, pos) > 2 && mc.world.getBlockState(pos).getBlock() == Blocks.COBBLESTONE)
                .min(Comparator.comparing(pos -> getDistance(soundPos, pos))).ifPresent(pos -> {
                    if (getCube(pos, 1, 1).stream().anyMatch(p -> mc.world.getBlockState(p).getBlock() == Blocks.ANVIL)) return;
                    long solidCount = getCube(pos, 1, 1).stream().filter(p -> {
                        BlockState s = mc.world.getBlockState(p); return !s.isAir() && s.isSolidBlock(mc.world, p);
                    }).count();
                    if (solidCount == 18 || solidCount == 15 || solidCount == 5) {
                        int time = (solidCount == 18 || solidCount == 15) ? 20000 : 15000;
                        Vec3d addPos = Vec3d.ofCenter(pos).add(0, solidCount == 5 ? -1.5 : 0, 0);
                        consumables.add(new Pair<>(System.currentTimeMillis() + time - 250, addPos));
                        consumableNames.put(addPos, (solidCount == 18 || solidCount == 15) ? "Plast" : "Trap");
                    }
                }), 250, TimeUnit.MILLISECONDS);
    }

    private void handleRenderEvent(Render2DEvent.Render2DEventData event) {
        if (!functions.isEnabled("Timers")) return;
        MatrixStack matrixStack = event.matrixStack();
        consumables.removeIf(cons -> (double) (cons.left() - System.currentTimeMillis()) <= 0);
        for (Pair<Long, Vec3d> cons : consumables) {
            Vector2f screenPos = ProjectionUtil.project(cons.right());
            if (screenPos.x == Float.MAX_VALUE || screenPos.y == Float.MAX_VALUE) continue;
            double time = MathUtil.round((double) (cons.left() - System.currentTimeMillis()) / 1000, 1);
            String text = consumableNames.getOrDefault(cons.right(), "Timer") + ": " + time + "s";
            float textWidth = Fonts.PS_BOLD.getWidth(text, 7f);
            RenderUtil.BLUR_RECT.draw(matrixStack, screenPos.x - textWidth / 2f, screenPos.y, textWidth + 6f, 10f, 2f, UIColors.blur());
            Fonts.PS_BOLD.drawText(matrixStack, text, screenPos.x - textWidth / 2f + 3f, screenPos.y + 3f, 7f, UIColors.textColor());
        }
    }

    private double getDistance(BlockPos pos1, BlockPos pos2) {
        return Math.sqrt(pos1.getSquaredDistance(pos2));
    }

    private List<BlockPos> getCube(BlockPos center, int xRadius, int yRadius) {
        List<BlockPos> sphere = new ArrayList<>();
        for (int x = -xRadius; x <= xRadius; x++) {
            for (int y = -yRadius; y <= yRadius; y++) {
                for (int z = -xRadius; z <= xRadius; z++) {
                    sphere.add(center.add(x, y, z));
                }
            }
        }
        return sphere;
    }
}

фикс для gpsManager:
GpsManager:
Expand Collapse Copy
public class GpsManager implements QuickImports {
    @Getter private static final GpsManager instance = new GpsManager();

    private Vector2i gpsPosition = null;
    private Vector2i lastGpsPosition = null;
    private String targetLabel = null;

    private final AnimationUtil distanceAnimation = new AnimationUtil();
    private final AnimationUtil switchAnimation = new AnimationUtil();

    public void setGps(Vector2i pos, String label) {
        this.gpsPosition = pos;
        this.targetLabel = label;
    }

    public void update(DrawContext context) {
        if (gpsPosition != null) {
            lastGpsPosition = gpsPosition;
        }

        if (context == null) return;

        float scale = RenderService.getInstance().getScale();

        boolean noGps = gpsPosition == null;
        boolean noLastGps = lastGpsPosition == null;
        float distance = !noLastGps ? getDistance(lastGpsPosition) : getDistance(new Vector2i(0, 0));
        float maxDistance = 10f;
        float minDistance = 3f;

        distanceAnimation.update();
        switchAnimation.update();

        distanceAnimation.run(distance <= minDistance ? 0.0 : distance >= maxDistance ? 1.0 : (distance - minDistance) / (maxDistance - minDistance), 500, Easing.EXPO_OUT);
        switchAnimation.run(noGps ? 0.0 : 1.0, 500, Easing.EXPO_OUT);

        if (distanceAnimation.getValue() < 0.1 || switchAnimation.getValue() < 0.1) return;

        float switchAnim = (float) switchAnimation.getValue();
        double combinedAnim = distanceAnimation.getValue() * switchAnim;

        float x = mc.getWindow().getScaledWidth() / 2f;
        float y = mc.getWindow().getScaledHeight() / 6f;

        float targetX = noGps ? 0f : (float) lastGpsPosition.x;
        float targetY = noGps ? 0f : (float) lastGpsPosition.y;
        float rotation = getRotations(new Vec2f(targetX, targetY)) - mc.player.getYaw();

        float arrowHeight = 12f * scale;

        context.getMatrices().push();
        context.getMatrices().translate(x, y, 0.0f);
        context.getMatrices().multiply(RotationAxis.POSITIVE_Z.rotationDegrees(rotation));
        context.getMatrices().translate(-x, -y, 0.0f);
        PointersModule.getInstance().drawPointer(context, x, y - arrowHeight * 1.75f, 30f * scale, ColorUtil.setAlpha(UIColors.gradient((int) combinedAnim), (int) (255 * combinedAnim)), true);
        RenderUtil.OTHER.scaleStop(context.getMatrices());

        float textY = (y + arrowHeight * (2f - switchAnim));

        Fonts.PS_BOLD.drawCenteredText(context.getMatrices(), String.format("%.1f", distance) + "m", x, textY, 8f * scale, UIColors.textColor((int) (255 * combinedAnim)));

        if (targetLabel != null && !noGps) {
            Fonts.PS_BOLD.drawCenteredText(context.getMatrices(), targetLabel, x, textY + (10f * scale), 7f * scale, UIColors.textColor((int) (255 * combinedAnim)));
        }
    }
чёт не понял все ровно что оно делает, особенно 1 функция
// --- FUNTIME --- keyBindings.put(new InventoryUtil.ItemUsage(Items.ENDER_EYE, this), new Pair<>(new BindSetting("Disorientation").value(-999), Mode.FUNTIME)); keyBindings.put(new InventoryUtil.ItemUsage(Items.NETHERITE_SCRAP, this), new Pair<>(new BindSetting("Trap").value(-999), Mode.FUNTIME)); keyBindings.put(new InventoryUtil.ItemUsage(Items.SUGAR, this), new Pair<>(new BindSetting("Clear dust").value(-999), Mode.FUNTIME)); keyBindings.put(new InventoryUtil.ItemUsage(Items.FIRE_CHARGE, this), new Pair<>(new BindSetting("Fire whirl").value(-999), Mode.FUNTIME)); keyBindings.put(new InventoryUtil.ItemUsage(Items.DRIED_KELP, this), new Pair<>(new BindSetting("Plast").value(-999), Mode.FUNTIME)); keyBindings.put(new InventoryUtil.ItemUsage(Items.PHANTOM_MEMBRANE, this), new Pair<>(new BindSetting("Divine aura").value(-999), Mode.FUNTIME)); // --- HOLYWORLD --- keyBindings.put(new InventoryUtil.ItemUsage(Items.PRISMARINE_SHARD, this), new Pair<>(new BindSetting("Explosive trap").value(-999), Mode.HOLYWORLD)); keyBindings.put(new InventoryUtil.ItemUsage(Items.POPPED_CHORUS_FRUIT, this), new Pair<>(new BindSetting("Default trap").value(-999), Mode.HOLYWORLD)); keyBindings.put(new InventoryUtil.ItemUsage(Items.NETHER_STAR, this), new Pair<>(new BindSetting("Stun").value(-999), Mode.HOLYWORLD)); keyBindings.put(new InventoryUtil.ItemUsage(Items.FIRE_CHARGE, this), new Pair<>(new BindSetting("Explosive thing").value(-999), Mode.HOLYWORLD)); keyBindings.put(new InventoryUtil.ItemUsage(Items.CLAY_BALL, this), new Pair<>(new BindSetting("Ливалочка").value(-999), Mode.LONYGRIEF));
вот это вообще зачем
 
Короче решил слить для вас ассистант для лунигрифа.

1. Auto-pvp (Автоматически ищет игроков с префиксами которые вы выбрали в настройке)
Например: Вы выбрали префикс игрока, но в пвп решил зайти кастомка, а потом игрок, кастомку скипаем и принимаем онли игрока.
2. Auto-Player (Автоматически делает для вас GPS с ником игрока и координатами)
Например: Вы прописали /rtp near, ассистант понял что нужно быстро вставить GPS до него и при телепорте у вас сразу есть GPS)
3. Livalka (ну думаю всем понятно) - Я не стал добавлять магма ливку, она бессмысленна.


Пожалуйста, авторизуйтесь для просмотра ссылки.


fixed GPS:
Посмотреть вложение 326598


code:
AssistantModule:
Expand Collapse Copy
package sweetie.evaware.client.features.modules.player;

import lombok.Getter;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.network.packet.s2c.play.GameMessageS2CPacket;
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
import net.minecraft.screen.GenericContainerScreenHandler;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.text.Text;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import org.joml.Vector2f;
import org.joml.Vector2i;
import sweetie.evaware.api.event.EventListener;
import sweetie.evaware.api.event.Listener;
import sweetie.evaware.api.event.events.client.PacketEvent;
import sweetie.evaware.api.event.events.client.TickEvent;
import sweetie.evaware.api.event.events.render.Render2DEvent;
import sweetie.evaware.api.module.Category;
import sweetie.evaware.api.module.Module;
import sweetie.evaware.api.module.ModuleRegister;
import sweetie.evaware.api.module.setting.BindSetting;
import sweetie.evaware.api.module.setting.BooleanSetting;
import sweetie.evaware.api.module.setting.ModeSetting;
import sweetie.evaware.api.module.setting.MultiBooleanSetting;
import sweetie.evaware.api.system.backend.Pair;
import sweetie.evaware.api.system.client.GpsManager;
import sweetie.evaware.api.utils.color.UIColors;
import sweetie.evaware.api.utils.math.MathUtil;
import sweetie.evaware.api.utils.math.ProjectionUtil;
import sweetie.evaware.api.utils.player.InventoryUtil;
import sweetie.evaware.api.utils.render.RenderUtil;
import sweetie.evaware.api.utils.render.fonts.Fonts;

import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

@ModuleRegister(name = "Assistant", category = Category.PLAYER)
public class AssistantModule extends Module {
    @Getter private static final AssistantModule instance = new AssistantModule();

    public enum Mode {
        FUNTIME, HOLYWORLD, LONYGRIEF;
    }

    private final Supplier<Boolean> isHotkeysEnabled = () -> getFunctions().isEnabled("Hotkeys");
    private final Supplier<Boolean> isHWKeys = () -> isHotkeysEnabled.get() && getMode().is("Holy World");
    private final Supplier<Boolean> isFTKeys = () -> isHotkeysEnabled.get() && getMode().is("Fun Time");
    private final Supplier<Boolean> isLGKeys = () -> isHotkeysEnabled.get() && getMode().is("Lony Grief");

    private Mode currentMode = Mode.FUNTIME;
    private String targetRival = null;

    @Getter private final MultiBooleanSetting functions = new MultiBooleanSetting("Functions").value(
            new BooleanSetting("Hotkeys").value(true),
            new BooleanSetting("Timers").value(false)
    );
    public final BooleanSetting autoPvpLony = new BooleanSetting("Auto-PvP").value(true).setVisible(isLGKeys);

    @Getter private final MultiBooleanSetting lonyPrefixes = new MultiBooleanSetting("Prefixes").value(
            new BooleanSetting("Player").value(true),
            new BooleanSetting("Legenda").value(true),
            new BooleanSetting("Pravitel").value(true),
            new BooleanSetting("Povelitel").value(true),
            new BooleanSetting("D.Admin").value(true),
            new BooleanSetting("Staff").value(false),
            new BooleanSetting("Eternity").value(true),
            new BooleanSetting("Luxe").value(true)
    ).setVisible(() -> isLGKeys.get() && autoPvpLony.getValue());

    @Getter private final ModeSetting mode = new ModeSetting("Mode").value("Fun Time")
            .values("Fun Time", "Holy World", "Lony Grief").setVisible(isHotkeysEnabled)
            .onAction(() -> {
                currentMode = switch (getMode().getValue()) {
                    case "Fun Time" -> Mode.FUNTIME;
                    case "Lony Grief" -> Mode.LONYGRIEF;
                    default -> Mode.HOLYWORLD;
                };
            });

    private final BooleanSetting legit = new BooleanSetting("Legit").value(true).setVisible(isHotkeysEnabled);
    public final BooleanSetting autoPlayerLony = new BooleanSetting("Auto-Player").value(true).setVisible(isLGKeys);

    private final Map<InventoryUtil.ItemUsage, Pair<BindSetting, Mode>> keyBindings = new LinkedHashMap<>();
    private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
    private final List<Pair<Long, Vec3d>> consumables = new ArrayList<>();
    private final Map<Vec3d, String> consumableNames = new HashMap<>();

    public AssistantModule() {
        // --- FUNTIME ---
        keyBindings.put(new InventoryUtil.ItemUsage(Items.ENDER_EYE, this), new Pair<>(new BindSetting("Disorientation").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.NETHERITE_SCRAP, this), new Pair<>(new BindSetting("Trap").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.SUGAR, this), new Pair<>(new BindSetting("Clear dust").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.FIRE_CHARGE, this), new Pair<>(new BindSetting("Fire whirl").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.DRIED_KELP, this), new Pair<>(new BindSetting("Plast").value(-999), Mode.FUNTIME));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.PHANTOM_MEMBRANE, this), new Pair<>(new BindSetting("Divine aura").value(-999), Mode.FUNTIME));

        // --- HOLYWORLD ---
        keyBindings.put(new InventoryUtil.ItemUsage(Items.PRISMARINE_SHARD, this), new Pair<>(new BindSetting("Explosive trap").value(-999), Mode.HOLYWORLD));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.POPPED_CHORUS_FRUIT, this), new Pair<>(new BindSetting("Default trap").value(-999), Mode.HOLYWORLD));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.NETHER_STAR, this), new Pair<>(new BindSetting("Stun").value(-999), Mode.HOLYWORLD));
        keyBindings.put(new InventoryUtil.ItemUsage(Items.FIRE_CHARGE, this), new Pair<>(new BindSetting("Explosive thing").value(-999), Mode.HOLYWORLD));

        keyBindings.put(new InventoryUtil.ItemUsage(Items.CLAY_BALL, this), new Pair<>(new BindSetting("Ливалочка").value(-999), Mode.LONYGRIEF));

        addSettings(functions, mode, lonyPrefixes, legit, autoPvpLony, autoPlayerLony);

        keyBindings.forEach((key, value) -> {
            if (value.right() == Mode.HOLYWORLD) value.left().setVisible(isHWKeys);
            if (value.right() == Mode.FUNTIME) value.left().setVisible(isFTKeys);
            if (value.right() == Mode.LONYGRIEF) value.left().setVisible(isLGKeys);
            addSettings(value.left());
        });
    }

    @Override
    public void onEvent() {
        EventListener tickEvent = TickEvent.getInstance().subscribe(new Listener<>(event -> handleTickEvent()));
        EventListener renderEvent = Render2DEvent.getInstance().subscribe(new Listener<>(this::handleRenderEvent));
        EventListener packetEvent = PacketEvent.getInstance().subscribe(new Listener<>(this::handlePacketEvent));
        addEvents(tickEvent, renderEvent, packetEvent);
    }

    private void handlePacketEvent(PacketEvent.PacketEventData event) {
        if (event.isSend() || mc.world == null) return;

        if (event.packet() instanceof PlaySoundS2CPacket soundPacket) {
            handleSoundPackets(soundPacket);
        }

        if (autoPvpLony.getValue() && currentMode == Mode.LONYGRIEF && event.packet() instanceof GameMessageS2CPacket chatPacket) {
            String rawMsg = chatPacket.content().getString();
            String cleanMsg = rawMsg.replaceAll("(?i)§[0-9a-fklmnor]", " ")
                    .replace("›", " ")
                    .replace(">", " ")
                    .trim();

            Pattern pvpPattern = Pattern.compile("Игрок\\s+([a-zA-Z0-9_]{3,16})\\s+ищет", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
            Matcher pvpMatcher = pvpPattern.matcher(cleanMsg);

            if (pvpMatcher.find()) {
                String nickname = pvpMatcher.group(1);
                if (nickname.equalsIgnoreCase(mc.player.getName().getString())) return;

                String rawPrefix = getPlayerRankFromTab(nickname);
                if (shouldClickPvp(rawPrefix)) {
                    this.targetRival = nickname;
                }
            }

            if (autoPlayerLony.getValue()) {
                Pattern pattern = Pattern.compile("(?:игроком|игрок)\\s+([^\\s!]+).+?(?:координаты|Кординаты|X):?\\s*(-?\\d+)[^\\d-]+-?\\d+[^\\d-]+(-?\\d+)", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
                Matcher matcher = pattern.matcher(cleanMsg);
                if (matcher.find()) {
                    String name = matcher.group(1);
                    try {
                        int x = Integer.parseInt(matcher.group(2));
                        int z = Integer.parseInt(matcher.group(3));
                        GpsManager.getInstance().setGps(new Vector2i(x, z), name);
                    } catch (NumberFormatException ignored) {}
                }
            }
        }
    }

    private void handleAutoPvPLogic() {
        if (targetRival == null || !(mc.player.currentScreenHandler instanceof GenericContainerScreenHandler handler)) return;

        for (int i = 0; i < handler.slots.size(); i++) {
            ItemStack stack = handler.getSlot(i).getStack();
            if (!stack.isEmpty() && stack.isOf(Items.TOTEM_OF_UNDYING)) {
                mc.interactionManager.clickSlot(handler.syncId, i, 0, SlotActionType.PICKUP, mc.player);
                targetRival = null;
                return;
            }
        }
    }

    private String getPlayerRankFromTab(String name) {
        if (mc.getNetworkHandler() == null) return "";

        for (var entry : mc.getNetworkHandler().getPlayerList()) {
            if (entry.getProfile().getName().equalsIgnoreCase(name)) {
                StringBuilder fullText = new StringBuilder();
                var team = entry.getScoreboardTeam();

                if (team != null) fullText.append(team.getPrefix().getString());
                if (entry.getDisplayName() != null) fullText.append(entry.getDisplayName().getString());

                return fullText.toString().replaceAll("(?i)§[0-9a-fklmnor]", "");
            }
        }
        return "";
    }

    private boolean shouldClickPvp(String text) {
        if (text == null || text.isEmpty()) return false;
        String upper = text.toUpperCase();

        // Проверяем каждую галочку в MultiBooleanSetting по отдельности
        if (lonyPrefixes.isEnabled("Player") && (upper.contains("PLAYER") || text.contains("ᴘʟᴀʏᴇʀ"))) return true;
        if (lonyPrefixes.isEnabled("Legenda") && (upper.contains("LEGENDA") || text.contains("ʟᴇɢᴇɴᴅᴀ"))) return true;
        if (lonyPrefixes.isEnabled("Pravitel") && (upper.contains("PRAVITEL") || text.contains("ᴘʀᴀᴠɪᴛᴇʟ"))) return true;
        if (lonyPrefixes.isEnabled("Povelitel") && (upper.contains("POVELITEL") || text.contains("ᴘᴏᴠᴇʟɪᴛᴇʟ"))) return true;
        if (lonyPrefixes.isEnabled("D.Admin") && (upper.contains("DADMIN") || text.contains("ᴅᴀᴅᴍɪɴ"))) return true;
        if (lonyPrefixes.isEnabled("Staff") && (upper.contains("STAFF") || upper.contains("ADMIN") || text.contains("sᴛᴀꜰꜰ"))) return true;
        if (lonyPrefixes.isEnabled("Eternity") && (upper.contains("ETERNITY") || text.contains("ᴇᴛᴇʀɴɪᴛʏ"))) return true;
        if (lonyPrefixes.isEnabled("Luxe") && (upper.contains("LUXE") || text.contains("ʟᴜxᴇ"))) return true;

        return false;
    }

    private void handleTickEvent() {
        if (mc.player == null) return;

        if (autoPvpLony.getValue() && currentMode == Mode.LONYGRIEF) {
            handleAutoPvPLogic();
        }

        if (!isHotkeysEnabled.get() || mc.currentScreen != null) return;

        keyBindings.forEach((usage, pair) -> {
            if (pair.right() == currentMode) {
                usage.handleUse(pair.left().getValue(), legit.getValue());
            }
        });
    }

    private void handleSoundPackets(PlaySoundS2CPacket soundPacket) {
        String soundPath = soundPacket.getSound().getIdAsString();
        if (soundPath.equals("minecraft:block.piston.contract")) {
            Vec3d pos = Vec3d.ofCenter(new BlockPos((int) soundPacket.getX(), (int) soundPacket.getY(), (int) soundPacket.getZ()));
            consumables.add(new Pair<>(System.currentTimeMillis() + 15000, pos));
            consumableNames.put(pos, "Trap");
        } else if (soundPath.equals("minecraft:block.anvil.place")) {
            handleAnvilLogic(soundPacket);
        }
    }

    private void handleAnvilLogic(PlaySoundS2CPacket soundPacket) {
        BlockPos soundPos = new BlockPos((int) soundPacket.getX(), (int) soundPacket.getY(), (int) soundPacket.getZ());
        scheduler.schedule(() -> getCube(soundPos, 4, 4).stream()
                .filter(pos -> getDistance(soundPos, pos) > 2 && mc.world.getBlockState(pos).getBlock() == Blocks.COBBLESTONE)
                .min(Comparator.comparing(pos -> getDistance(soundPos, pos))).ifPresent(pos -> {
                    if (getCube(pos, 1, 1).stream().anyMatch(p -> mc.world.getBlockState(p).getBlock() == Blocks.ANVIL)) return;
                    long solidCount = getCube(pos, 1, 1).stream().filter(p -> {
                        BlockState s = mc.world.getBlockState(p); return !s.isAir() && s.isSolidBlock(mc.world, p);
                    }).count();
                    if (solidCount == 18 || solidCount == 15 || solidCount == 5) {
                        int time = (solidCount == 18 || solidCount == 15) ? 20000 : 15000;
                        Vec3d addPos = Vec3d.ofCenter(pos).add(0, solidCount == 5 ? -1.5 : 0, 0);
                        consumables.add(new Pair<>(System.currentTimeMillis() + time - 250, addPos));
                        consumableNames.put(addPos, (solidCount == 18 || solidCount == 15) ? "Plast" : "Trap");
                    }
                }), 250, TimeUnit.MILLISECONDS);
    }

    private void handleRenderEvent(Render2DEvent.Render2DEventData event) {
        if (!functions.isEnabled("Timers")) return;
        MatrixStack matrixStack = event.matrixStack();
        consumables.removeIf(cons -> (double) (cons.left() - System.currentTimeMillis()) <= 0);
        for (Pair<Long, Vec3d> cons : consumables) {
            Vector2f screenPos = ProjectionUtil.project(cons.right());
            if (screenPos.x == Float.MAX_VALUE || screenPos.y == Float.MAX_VALUE) continue;
            double time = MathUtil.round((double) (cons.left() - System.currentTimeMillis()) / 1000, 1);
            String text = consumableNames.getOrDefault(cons.right(), "Timer") + ": " + time + "s";
            float textWidth = Fonts.PS_BOLD.getWidth(text, 7f);
            RenderUtil.BLUR_RECT.draw(matrixStack, screenPos.x - textWidth / 2f, screenPos.y, textWidth + 6f, 10f, 2f, UIColors.blur());
            Fonts.PS_BOLD.drawText(matrixStack, text, screenPos.x - textWidth / 2f + 3f, screenPos.y + 3f, 7f, UIColors.textColor());
        }
    }

    private double getDistance(BlockPos pos1, BlockPos pos2) {
        return Math.sqrt(pos1.getSquaredDistance(pos2));
    }

    private List<BlockPos> getCube(BlockPos center, int xRadius, int yRadius) {
        List<BlockPos> sphere = new ArrayList<>();
        for (int x = -xRadius; x <= xRadius; x++) {
            for (int y = -yRadius; y <= yRadius; y++) {
                for (int z = -xRadius; z <= xRadius; z++) {
                    sphere.add(center.add(x, y, z));
                }
            }
        }
        return sphere;
    }
}

фикс для gpsManager:
GpsManager:
Expand Collapse Copy
public class GpsManager implements QuickImports {
    @Getter private static final GpsManager instance = new GpsManager();

    private Vector2i gpsPosition = null;
    private Vector2i lastGpsPosition = null;
    private String targetLabel = null;

    private final AnimationUtil distanceAnimation = new AnimationUtil();
    private final AnimationUtil switchAnimation = new AnimationUtil();

    public void setGps(Vector2i pos, String label) {
        this.gpsPosition = pos;
        this.targetLabel = label;
    }

    public void update(DrawContext context) {
        if (gpsPosition != null) {
            lastGpsPosition = gpsPosition;
        }

        if (context == null) return;

        float scale = RenderService.getInstance().getScale();

        boolean noGps = gpsPosition == null;
        boolean noLastGps = lastGpsPosition == null;
        float distance = !noLastGps ? getDistance(lastGpsPosition) : getDistance(new Vector2i(0, 0));
        float maxDistance = 10f;
        float minDistance = 3f;

        distanceAnimation.update();
        switchAnimation.update();

        distanceAnimation.run(distance <= minDistance ? 0.0 : distance >= maxDistance ? 1.0 : (distance - minDistance) / (maxDistance - minDistance), 500, Easing.EXPO_OUT);
        switchAnimation.run(noGps ? 0.0 : 1.0, 500, Easing.EXPO_OUT);

        if (distanceAnimation.getValue() < 0.1 || switchAnimation.getValue() < 0.1) return;

        float switchAnim = (float) switchAnimation.getValue();
        double combinedAnim = distanceAnimation.getValue() * switchAnim;

        float x = mc.getWindow().getScaledWidth() / 2f;
        float y = mc.getWindow().getScaledHeight() / 6f;

        float targetX = noGps ? 0f : (float) lastGpsPosition.x;
        float targetY = noGps ? 0f : (float) lastGpsPosition.y;
        float rotation = getRotations(new Vec2f(targetX, targetY)) - mc.player.getYaw();

        float arrowHeight = 12f * scale;

        context.getMatrices().push();
        context.getMatrices().translate(x, y, 0.0f);
        context.getMatrices().multiply(RotationAxis.POSITIVE_Z.rotationDegrees(rotation));
        context.getMatrices().translate(-x, -y, 0.0f);
        PointersModule.getInstance().drawPointer(context, x, y - arrowHeight * 1.75f, 30f * scale, ColorUtil.setAlpha(UIColors.gradient((int) combinedAnim), (int) (255 * combinedAnim)), true);
        RenderUtil.OTHER.scaleStop(context.getMatrices());

        float textY = (y + arrowHeight * (2f - switchAnim));

        Fonts.PS_BOLD.drawCenteredText(context.getMatrices(), String.format("%.1f", distance) + "m", x, textY, 8f * scale, UIColors.textColor((int) (255 * combinedAnim)));

        if (targetLabel != null && !noGps) {
            Fonts.PS_BOLD.drawCenteredText(context.getMatrices(), targetLabel, x, textY + (10f * scale), 7f * scale, UIColors.textColor((int) (255 * combinedAnim)));
        }
    }
чё за ассистант ??? да и по коду с самими функциями видно что дерьмо
 
чёт не понял все ровно что оно делает, особенно 1 функция

вот это вообще зачем
Это фулл ассистант с евавара, уже был в сурсах, а там хардкод.
Короче так, там чисто моя логика сделана нормально
эт не я
 
Назад
Сверху Снизу