Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Обход античита Обход Spookytime-Rw spider Full Bypass

Начинающий
Начинающий
Статус
Онлайн
Регистрация
26 Июн 2025
Сообщения
11
Реакции
0
Выберите загрузчик игры
  1. Прочие моды
Пожалуйста, авторизуйтесь для просмотра ссылки.


JavaScript:
Expand Collapse Copy
package eva.ware.modules.impl.movement;

import com.google.common.eventbus.Subscribe;
import eva.ware.Evaware;
import eva.ware.events.EventMotion;
import eva.ware.events.EventPacket;
import eva.ware.events.EventUpdate;
import eva.ware.events.EventInput;
import eva.ware.modules.api.Category;
import eva.ware.modules.api.Module;
import eva.ware.modules.api.ModuleRegister;
import eva.ware.modules.settings.impl.CheckBoxSetting;
import eva.ware.modules.settings.impl.ModeSetting;
import eva.ware.modules.settings.impl.SliderSetting;
import eva.ware.utils.math.TimerUtility;
import eva.ware.utils.player.MouseUtility;
import eva.ware.utils.player.MoveUtility;
import eva.ware.utils.player.PlayerUtility;
import net.minecraft.block.BlockState;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.IPacket;
import net.minecraft.network.play.client.CEntityActionPacket;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.network.play.client.CPlayerTryUseItemPacket;
import net.minecraft.network.play.server.SEntityMetadataPacket;
import net.minecraft.network.play.server.SPlayerPositionLookPacket;
import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;

import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;

@ModuleRegister(name = "Spider", category = Category.Movement)
public class Spider extends Module {
    public ModeSetting mode = new ModeSetting("Mode", "Grim", "RW", "Grim", "Grim 2", "Matrix", "Elytra", "spookytime");
    private final SliderSetting spiderSpeed = new SliderSetting("Скорость", 2.0f, 1.0f, 10.0f, 0.05f).visibleIf(() -> mode.is("Matrix") || mode.is("RW"));
    private final CheckBoxSetting bypass = new CheckBoxSetting("Второй обход", true).visibleIf(() -> mode.is("Elytra"));

    // Настройки ротации для spookytime
    private final CheckBoxSetting rotation = new CheckBoxSetting("Ротация", true).visibleIf(() -> mode.is("spookytime"));
    private final CheckBoxSetting moveFix = new CheckBoxSetting("Коррекция движения", true).visibleIf(() -> mode.is("spookytime"));
    private final SliderSetting rotationPitch = new SliderSetting("Угол наклона", 45.0f, 0, 90, 1).visibleIf(() -> mode.is("spookytime") && rotation.getValue());

    TimerUtility timerUtility = new TimerUtility();
    TimerUtility blockPlaceDelay = new TimerUtility();

    int oldItem = -1;
    int oldItem1 = -1;
    int i;
    long speed;

    // Переменные для ротации
    private Vector2f targetRotation;
    private BlockPos currentTarget = null;

    // SpookyTime переменные
    private Timer timer = new Timer();
    private boolean canUse = true;
    private final Random random = new Random();

    public Spider() {
        addSettings(mode, bypass, spiderSpeed, rotation, moveFix, rotationPitch);
    }

    @Override
    public boolean onEnable() {
        super.onEnable();
        targetRotation = null;
        currentTarget = null;

        // Инициализация SpookyTime
        if (mode.is("spookytime")) {
            timer = new Timer();
            canUse = true;
            if (mc.gameSettings != null) {
                mc.gameSettings.keyBindSneak.setPressed(false);
            }
        }
        return false;
    }

    @Override
    public void onDisable() {
        super.onDisable();
        targetRotation = null;
        currentTarget = null;

        // Сброс SpookyTime при выключении
        if (mode.is("spookytime")) {
            timer.cancel();
            timer = new Timer();
            canUse = true;
            if (mc.gameSettings != null) {
                mc.gameSettings.keyBindSneak.setPressed(false);
                mc.gameSettings.keyBindJump.setPressed(false);
            }
        }

        // Сброс ротации при выключении
        if (moveFix.getValue() && mc.player != null) {
            mc.player.rotationYawOffset = Integer.MIN_VALUE;
        }
    }

    @Subscribe
    public void onMotion(EventMotion motion) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "RW" -> {
                // Реализация RW из предоставленного кода
                int bucketSlot = findBucketInInventory();
                if (bucketSlot != -1) {
                    if (mc.player.getHeldItemMainhand().getItem() != Items.WATER_BUCKET) {
                        mc.player.inventory.currentItem = bucketSlot;
                    }

                    if (mc.player.collidedHorizontally) {
                        mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
                        mc.player.setMotion(mc.player.getMotion().x, 0.36, mc.player.getMotion().z);
                    }
                }
            }
            case "Matrix" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                long speed = MathHelper.clamp(500 - (spiderSpeed.getValue().longValue() / 2 * 100), 0, 500);
                if (timerUtility.isReached(speed)) {
                    motion.setOnGround(true);
                    mc.player.setOnGround(true);
                    mc.player.collidedVertically = true;
                    mc.player.collidedHorizontally = true;
                    mc.player.isAirBorne = true;
                    mc.player.jump();
                    timerUtility.reset();
                }
            }
            case "Grim" -> {
                int slotInHotBar = getSlotInInventoryOrHotbar(true);

                if (slotInHotBar == -1) {
                    print("Блоки не найдены!");
                    toggle();
                    return;
                }
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (mc.player.isOnGround()) {
                    motion.setOnGround(true);
                    mc.player.setOnGround(true);
                    mc.player.jump();
                }
                if (mc.player.fallDistance > 0 && mc.player.fallDistance < 2) {
                    placeBlocks(motion, slotInHotBar);
                }
            }

            case "spookytime" -> {
                handleSpookyTimeMode(motion);
            }

            case "Grim 2" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (!mc.player.isOnGround()) {
                    speed = (long) MathHelper.clamp(500L - spiderSpeed.getValue() / 2L * 100L, 0L, 500L);
                    if (this.timerUtility.isReached(speed)) {
                        mc.gameSettings.keyBindSneak.setPressed(true);
                        motion.setOnGround(true);
                        mc.player.setOnGround(true);
                        mc.player.collidedVertically = true;
                        mc.player.collidedHorizontally = true;
                        mc.player.isAirBorne = true;
                        if (mc.player.fallDistance != 0.0F) {
                            mc.gameSettings.keyBindForward.setPressed(true);
                            mc.gameSettings.keyBindForward.setPressed(false);
                        }

                        if (!mc.player.movementInput.jump) mc.player.jump();
                        mc.gameSettings.keyBindSneak.setPressed(false);
                        this.timerUtility.reset();
                    }
                }
            }

            case "Elytra" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                motion.setPitch(0.0F);
                mc.player.rotationPitchHead = 0.0F;
            }
        }
    }

    // SpookyTime реализация из первого кода
    private void handleSpookyTimeMode(EventMotion motion) {
        if (mc.player == null || mc.player.isInWater()) {
            return;
        }

        // Отладочный вывод для проверки значений
        System.out.println("Rotation enabled: " + rotation.getValue());
        System.out.println("Current pitch setting: " + rotationPitch.getValue());

        // Устанавливаем ротацию если включена
        if (rotation.getValue()) {
            float[] rot = calculateRotationToLookDirection();
            targetRotation = new Vector2f(rot[0], rot[1]);

            motion.setYaw(targetRotation.x);
            motion.setPitch(targetRotation.y);

            // Обновляем голову игрока
            mc.player.rotationYawHead = targetRotation.x;
            mc.player.renderYawOffset = PlayerUtility.calculateCorrectYawOffset(targetRotation.x);
            mc.player.rotationPitchHead = targetRotation.y;

            // Отладочный вывод примененных значений
            System.out.println("Applied rotation - Yaw: " + targetRotation.x + ", Pitch: " + targetRotation.y);
        }

        if (!mc.player.collidedHorizontally) {
            if (mc.gameSettings.keyBindSneak.isKeyDown()) {
                mc.gameSettings.keyBindSneak.setPressed(false);
            }
            return;
        }

        int waterSlot = getWaterBucketSlot();
        if (waterSlot == -1) {
            print("Водное ведро не найдено!");
            toggle();
            return;
        }

        if (canUse) {
            int currentSlot = mc.player.inventory.currentItem;

            if (waterSlot != currentSlot) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(waterSlot));
            }

            mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(Hand.MAIN_HAND));

            if (waterSlot != currentSlot) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(currentSlot));
            }

            double yBoost = 0.42D + (random.nextDouble() * 0.02D);
            mc.player.motion.y = yBoost;

            canUse = false;
            timer.schedule(new TimerTask() {
                @Override
                public void run() {
                    canUse = true;
                }
            }, getAppliedDelayMs());
        }

        mc.gameSettings.keyBindSneak.setPressed(true);
    }

    private int getAppliedDelayMs() {
        float base = 0.45F;
        int ms = (int) (base * 1000.0F);
        int offset = random.nextInt(60) - 30;
        return Math.max(150, ms + offset);
    }

    @Subscribe
    public void onInput(EventInput e) {
        // Коррекция движения при включенной ротации в режиме spookytime
        if (mode.is("spookytime") && rotation.getValue() && moveFix.getValue() && targetRotation != null) {
            MoveUtility.fixMovement(e, targetRotation.x);
        }
    }

    @Subscribe
    public void onUpdate(EventUpdate e) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "Elytra" -> {
                if (!bypass.getValue()) {
                    if (!mc.player.collidedHorizontally) {
                        return;
                    }
                    for (i = 0; i < 9; ++i) {
                        if (mc.player.inventory.getStackInSlot(i).getItem() == Items.ELYTRA && !mc.player.isOnGround() && mc.player.collidedHorizontally && mc.player.fallDistance == 0.0F) {
                            mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                            mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.START_FALL_FLYING));
                            MoveUtility.setMotion(0.06);
                            mc.player.motion.y = 0.366;
                            mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                            this.oldItem = i;
                        }
                    }
                } else {
                    if ((mc.player.inventory.armorInventory.get(2)).getItem() != Items.ELYTRA && mc.player.collidedHorizontally) {
                        for(i = 0; i < 9; ++i) {
                            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.ELYTRA) {
                                mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                                this.oldItem1 = i;
                                this.timerUtility.reset();
                            }
                        }
                    }

                    if (mc.player.collidedHorizontally) {
                        mc.gameSettings.keyBindJump.setPressed(false);
                        if (this.timerUtility.isReached(180L)) {
                            mc.gameSettings.keyBindJump.setPressed(true);
                        }
                    }

                    if ((mc.player.inventory.armorInventory.get(2)).getItem() == Items.ELYTRA && !mc.player.collidedHorizontally && this.oldItem1 != -1) {
                        mc.playerController.windowClick(0, 6, this.oldItem1, ClickType.SWAP, mc.player);
                        this.oldItem1 = -1;
                    }

                    if ((mc.player.inventory.armorInventory.get(2)).getItem() == Items.ELYTRA && !mc.player.isOnGround() && mc.player.collidedHorizontally) {
                        if (mc.player.fallDistance != 0.0F) {
                            return;
                        }

                        mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.START_FALL_FLYING));
                        MoveUtility.setMotion(0.02);
                        mc.player.motion.y = 0.36;
                    }
                }
            }
        }
    }

    @Subscribe
    public void onPacket(EventPacket e) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "Elytra" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (!bypass.getValue()) {
                    IPacket iPacket = e.getPacket();
                    if (iPacket instanceof SPlayerPositionLookPacket) {
                        SPlayerPositionLookPacket p = (SPlayerPositionLookPacket) iPacket;
                        mc.player.func_242277_a(new Vector3d(p.getX(), p.getY(), p.getZ()));
                        mc.player.setRawPosition(p.getX(), p.getY(), p.getZ());
                        return;
                    }

                    if (e.getPacket() instanceof SEntityMetadataPacket && ((SEntityMetadataPacket) e.getPacket()).getEntityId() == mc.player.getEntityId()) {
                        e.cancel();
                    }
                } else {
                    if (e.getPacket() instanceof SEntityMetadataPacket && ((SEntityMetadataPacket) e.getPacket()).getEntityId() == mc.player.getEntityId()) {
                        e.cancel();
                    }
                }
            }
        }
    }

    // Метод для поиска ведра воды в инвентаре (из RW кода)
    private int findBucketInInventory() {
        for (int i = 0; i < 9; i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack != null && stack.getItem() == Items.WATER_BUCKET) {
                return i;
            }
        }
        return -1;
    }

    // ИСПРАВЛЕННЫЙ МЕТОД: РОТАЦИЯ В НАПРАВЛЕНИИ ВЗГЛЯДА ИГРОКА
    private float[] calculateRotationToLookDirection() {
        // Используем текущий yaw игрока
        float yaw = mc.player.rotationYaw;

        // ИСПРАВЛЕНИЕ: Используем значение из настройки rotationPitch
        float pitch = rotationPitch.getValue().floatValue();

        return new float[]{MathHelper.wrapDegrees(yaw), MathHelper.clamp(pitch, -90.0f, 90.0f)};
    }

    // Ищет водное ведро в хотбаре
    private int getWaterBucketSlot() {
        for (int i = 0; i < 9; i++) {
            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.WATER_BUCKET) {
                return i;
            }
        }
        return -1;
    }

    // Старый метод для расчета ротации на блок (оставлен для совместимости)
    private float[] calculateRotation(BlockPos targetPos) {
        return calculateRotationToLookDirection(); // Теперь используем новый метод
    }

    // Вспомогательный метод для проверки активности ротации
    public boolean isRotationActive() {
        return mode.is("spookytime") && rotation.getValue() && targetRotation != null && moveFix.getValue();
    }

    // СТАРЫЕ МЕТОДЫ ДЛЯ ДРУГИХ РЕЖИМОВ
    private void placeBlocks(EventMotion motion, int slot) {
        int last = mc.player.inventory.currentItem;
        mc.player.inventory.currentItem = slot;
        motion.setPitch(80);
        motion.setYaw(mc.player.getHorizontalFacing().getHorizontalAngle());
        BlockRayTraceResult r = (BlockRayTraceResult) MouseUtility.rayTrace(4, motion.getYaw(), motion.getPitch(), mc.player);

        if (mc.player.inventory.getStackInSlot(slot).getItem() == Items.WATER_BUCKET) {
            mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
        } else {
            mc.player.swingArm(Hand.MAIN_HAND);
            mc.playerController.processRightClickBlock(mc.player, mc.world, Hand.MAIN_HAND, r);
        }

        mc.player.inventory.currentItem = last;
        mc.player.fallDistance = 0;
    }

    public int getSlotInInventoryOrHotbar(boolean inHotBar) {
        int firstSlot = inHotBar ? 0 : 9;
        int lastSlot = inHotBar ? 9 : 36;
        int finalSlot = -1;

        for (int i = firstSlot; i < lastSlot; i++) {
            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.TORCH) {
                continue;
            }

            if (mc.player.inventory.getStackInSlot(i).getItem() instanceof BlockItem) {
                finalSlot = i;
                break;
            }
        }

        if (finalSlot == -1) {
            for (int i = firstSlot; i < lastSlot; i++) {
                if (mc.player.inventory.getStackInSlot(i).getItem() == Items.WATER_BUCKET) {
                    finalSlot = i;
                    break;
                }
            }
        }

        return finalSlot;
    }
}
мне было лень поэтому ctrl+c ctrl+v
 
Пожалуйста, авторизуйтесь для просмотра ссылки.


JavaScript:
Expand Collapse Copy
package eva.ware.modules.impl.movement;

import com.google.common.eventbus.Subscribe;
import eva.ware.Evaware;
import eva.ware.events.EventMotion;
import eva.ware.events.EventPacket;
import eva.ware.events.EventUpdate;
import eva.ware.events.EventInput;
import eva.ware.modules.api.Category;
import eva.ware.modules.api.Module;
import eva.ware.modules.api.ModuleRegister;
import eva.ware.modules.settings.impl.CheckBoxSetting;
import eva.ware.modules.settings.impl.ModeSetting;
import eva.ware.modules.settings.impl.SliderSetting;
import eva.ware.utils.math.TimerUtility;
import eva.ware.utils.player.MouseUtility;
import eva.ware.utils.player.MoveUtility;
import eva.ware.utils.player.PlayerUtility;
import net.minecraft.block.BlockState;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.IPacket;
import net.minecraft.network.play.client.CEntityActionPacket;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.network.play.client.CPlayerTryUseItemPacket;
import net.minecraft.network.play.server.SEntityMetadataPacket;
import net.minecraft.network.play.server.SPlayerPositionLookPacket;
import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;

import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;

@ModuleRegister(name = "Spider", category = Category.Movement)
public class Spider extends Module {
    public ModeSetting mode = new ModeSetting("Mode", "Grim", "RW", "Grim", "Grim 2", "Matrix", "Elytra", "spookytime");
    private final SliderSetting spiderSpeed = new SliderSetting("Скорость", 2.0f, 1.0f, 10.0f, 0.05f).visibleIf(() -> mode.is("Matrix") || mode.is("RW"));
    private final CheckBoxSetting bypass = new CheckBoxSetting("Второй обход", true).visibleIf(() -> mode.is("Elytra"));

    // Настройки ротации для spookytime
    private final CheckBoxSetting rotation = new CheckBoxSetting("Ротация", true).visibleIf(() -> mode.is("spookytime"));
    private final CheckBoxSetting moveFix = new CheckBoxSetting("Коррекция движения", true).visibleIf(() -> mode.is("spookytime"));
    private final SliderSetting rotationPitch = new SliderSetting("Угол наклона", 45.0f, 0, 90, 1).visibleIf(() -> mode.is("spookytime") && rotation.getValue());

    TimerUtility timerUtility = new TimerUtility();
    TimerUtility blockPlaceDelay = new TimerUtility();

    int oldItem = -1;
    int oldItem1 = -1;
    int i;
    long speed;

    // Переменные для ротации
    private Vector2f targetRotation;
    private BlockPos currentTarget = null;

    // SpookyTime переменные
    private Timer timer = new Timer();
    private boolean canUse = true;
    private final Random random = new Random();

    public Spider() {
        addSettings(mode, bypass, spiderSpeed, rotation, moveFix, rotationPitch);
    }

    @Override
    public boolean onEnable() {
        super.onEnable();
        targetRotation = null;
        currentTarget = null;

        // Инициализация SpookyTime
        if (mode.is("spookytime")) {
            timer = new Timer();
            canUse = true;
            if (mc.gameSettings != null) {
                mc.gameSettings.keyBindSneak.setPressed(false);
            }
        }
        return false;
    }

    @Override
    public void onDisable() {
        super.onDisable();
        targetRotation = null;
        currentTarget = null;

        // Сброс SpookyTime при выключении
        if (mode.is("spookytime")) {
            timer.cancel();
            timer = new Timer();
            canUse = true;
            if (mc.gameSettings != null) {
                mc.gameSettings.keyBindSneak.setPressed(false);
                mc.gameSettings.keyBindJump.setPressed(false);
            }
        }

        // Сброс ротации при выключении
        if (moveFix.getValue() && mc.player != null) {
            mc.player.rotationYawOffset = Integer.MIN_VALUE;
        }
    }

    @Subscribe
    public void onMotion(EventMotion motion) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "RW" -> {
                // Реализация RW из предоставленного кода
                int bucketSlot = findBucketInInventory();
                if (bucketSlot != -1) {
                    if (mc.player.getHeldItemMainhand().getItem() != Items.WATER_BUCKET) {
                        mc.player.inventory.currentItem = bucketSlot;
                    }

                    if (mc.player.collidedHorizontally) {
                        mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
                        mc.player.setMotion(mc.player.getMotion().x, 0.36, mc.player.getMotion().z);
                    }
                }
            }
            case "Matrix" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                long speed = MathHelper.clamp(500 - (spiderSpeed.getValue().longValue() / 2 * 100), 0, 500);
                if (timerUtility.isReached(speed)) {
                    motion.setOnGround(true);
                    mc.player.setOnGround(true);
                    mc.player.collidedVertically = true;
                    mc.player.collidedHorizontally = true;
                    mc.player.isAirBorne = true;
                    mc.player.jump();
                    timerUtility.reset();
                }
            }
            case "Grim" -> {
                int slotInHotBar = getSlotInInventoryOrHotbar(true);

                if (slotInHotBar == -1) {
                    print("Блоки не найдены!");
                    toggle();
                    return;
                }
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (mc.player.isOnGround()) {
                    motion.setOnGround(true);
                    mc.player.setOnGround(true);
                    mc.player.jump();
                }
                if (mc.player.fallDistance > 0 && mc.player.fallDistance < 2) {
                    placeBlocks(motion, slotInHotBar);
                }
            }

            case "spookytime" -> {
                handleSpookyTimeMode(motion);
            }

            case "Grim 2" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (!mc.player.isOnGround()) {
                    speed = (long) MathHelper.clamp(500L - spiderSpeed.getValue() / 2L * 100L, 0L, 500L);
                    if (this.timerUtility.isReached(speed)) {
                        mc.gameSettings.keyBindSneak.setPressed(true);
                        motion.setOnGround(true);
                        mc.player.setOnGround(true);
                        mc.player.collidedVertically = true;
                        mc.player.collidedHorizontally = true;
                        mc.player.isAirBorne = true;
                        if (mc.player.fallDistance != 0.0F) {
                            mc.gameSettings.keyBindForward.setPressed(true);
                            mc.gameSettings.keyBindForward.setPressed(false);
                        }

                        if (!mc.player.movementInput.jump) mc.player.jump();
                        mc.gameSettings.keyBindSneak.setPressed(false);
                        this.timerUtility.reset();
                    }
                }
            }

            case "Elytra" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                motion.setPitch(0.0F);
                mc.player.rotationPitchHead = 0.0F;
            }
        }
    }

    // SpookyTime реализация из первого кода
    private void handleSpookyTimeMode(EventMotion motion) {
        if (mc.player == null || mc.player.isInWater()) {
            return;
        }

        // Отладочный вывод для проверки значений
        System.out.println("Rotation enabled: " + rotation.getValue());
        System.out.println("Current pitch setting: " + rotationPitch.getValue());

        // Устанавливаем ротацию если включена
        if (rotation.getValue()) {
            float[] rot = calculateRotationToLookDirection();
            targetRotation = new Vector2f(rot[0], rot[1]);

            motion.setYaw(targetRotation.x);
            motion.setPitch(targetRotation.y);

            // Обновляем голову игрока
            mc.player.rotationYawHead = targetRotation.x;
            mc.player.renderYawOffset = PlayerUtility.calculateCorrectYawOffset(targetRotation.x);
            mc.player.rotationPitchHead = targetRotation.y;

            // Отладочный вывод примененных значений
            System.out.println("Applied rotation - Yaw: " + targetRotation.x + ", Pitch: " + targetRotation.y);
        }

        if (!mc.player.collidedHorizontally) {
            if (mc.gameSettings.keyBindSneak.isKeyDown()) {
                mc.gameSettings.keyBindSneak.setPressed(false);
            }
            return;
        }

        int waterSlot = getWaterBucketSlot();
        if (waterSlot == -1) {
            print("Водное ведро не найдено!");
            toggle();
            return;
        }

        if (canUse) {
            int currentSlot = mc.player.inventory.currentItem;

            if (waterSlot != currentSlot) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(waterSlot));
            }

            mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(Hand.MAIN_HAND));

            if (waterSlot != currentSlot) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(currentSlot));
            }

            double yBoost = 0.42D + (random.nextDouble() * 0.02D);
            mc.player.motion.y = yBoost;

            canUse = false;
            timer.schedule(new TimerTask() {
                @Override
                public void run() {
                    canUse = true;
                }
            }, getAppliedDelayMs());
        }

        mc.gameSettings.keyBindSneak.setPressed(true);
    }

    private int getAppliedDelayMs() {
        float base = 0.45F;
        int ms = (int) (base * 1000.0F);
        int offset = random.nextInt(60) - 30;
        return Math.max(150, ms + offset);
    }

    @Subscribe
    public void onInput(EventInput e) {
        // Коррекция движения при включенной ротации в режиме spookytime
        if (mode.is("spookytime") && rotation.getValue() && moveFix.getValue() && targetRotation != null) {
            MoveUtility.fixMovement(e, targetRotation.x);
        }
    }

    @Subscribe
    public void onUpdate(EventUpdate e) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "Elytra" -> {
                if (!bypass.getValue()) {
                    if (!mc.player.collidedHorizontally) {
                        return;
                    }
                    for (i = 0; i < 9; ++i) {
                        if (mc.player.inventory.getStackInSlot(i).getItem() == Items.ELYTRA && !mc.player.isOnGround() && mc.player.collidedHorizontally && mc.player.fallDistance == 0.0F) {
                            mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                            mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.START_FALL_FLYING));
                            MoveUtility.setMotion(0.06);
                            mc.player.motion.y = 0.366;
                            mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                            this.oldItem = i;
                        }
                    }
                } else {
                    if ((mc.player.inventory.armorInventory.get(2)).getItem() != Items.ELYTRA && mc.player.collidedHorizontally) {
                        for(i = 0; i < 9; ++i) {
                            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.ELYTRA) {
                                mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                                this.oldItem1 = i;
                                this.timerUtility.reset();
                            }
                        }
                    }

                    if (mc.player.collidedHorizontally) {
                        mc.gameSettings.keyBindJump.setPressed(false);
                        if (this.timerUtility.isReached(180L)) {
                            mc.gameSettings.keyBindJump.setPressed(true);
                        }
                    }

                    if ((mc.player.inventory.armorInventory.get(2)).getItem() == Items.ELYTRA && !mc.player.collidedHorizontally && this.oldItem1 != -1) {
                        mc.playerController.windowClick(0, 6, this.oldItem1, ClickType.SWAP, mc.player);
                        this.oldItem1 = -1;
                    }

                    if ((mc.player.inventory.armorInventory.get(2)).getItem() == Items.ELYTRA && !mc.player.isOnGround() && mc.player.collidedHorizontally) {
                        if (mc.player.fallDistance != 0.0F) {
                            return;
                        }

                        mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.START_FALL_FLYING));
                        MoveUtility.setMotion(0.02);
                        mc.player.motion.y = 0.36;
                    }
                }
            }
        }
    }

    @Subscribe
    public void onPacket(EventPacket e) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "Elytra" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (!bypass.getValue()) {
                    IPacket iPacket = e.getPacket();
                    if (iPacket instanceof SPlayerPositionLookPacket) {
                        SPlayerPositionLookPacket p = (SPlayerPositionLookPacket) iPacket;
                        mc.player.func_242277_a(new Vector3d(p.getX(), p.getY(), p.getZ()));
                        mc.player.setRawPosition(p.getX(), p.getY(), p.getZ());
                        return;
                    }

                    if (e.getPacket() instanceof SEntityMetadataPacket && ((SEntityMetadataPacket) e.getPacket()).getEntityId() == mc.player.getEntityId()) {
                        e.cancel();
                    }
                } else {
                    if (e.getPacket() instanceof SEntityMetadataPacket && ((SEntityMetadataPacket) e.getPacket()).getEntityId() == mc.player.getEntityId()) {
                        e.cancel();
                    }
                }
            }
        }
    }

    // Метод для поиска ведра воды в инвентаре (из RW кода)
    private int findBucketInInventory() {
        for (int i = 0; i < 9; i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack != null && stack.getItem() == Items.WATER_BUCKET) {
                return i;
            }
        }
        return -1;
    }

    // ИСПРАВЛЕННЫЙ МЕТОД: РОТАЦИЯ В НАПРАВЛЕНИИ ВЗГЛЯДА ИГРОКА
    private float[] calculateRotationToLookDirection() {
        // Используем текущий yaw игрока
        float yaw = mc.player.rotationYaw;

        // ИСПРАВЛЕНИЕ: Используем значение из настройки rotationPitch
        float pitch = rotationPitch.getValue().floatValue();

        return new float[]{MathHelper.wrapDegrees(yaw), MathHelper.clamp(pitch, -90.0f, 90.0f)};
    }

    // Ищет водное ведро в хотбаре
    private int getWaterBucketSlot() {
        for (int i = 0; i < 9; i++) {
            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.WATER_BUCKET) {
                return i;
            }
        }
        return -1;
    }

    // Старый метод для расчета ротации на блок (оставлен для совместимости)
    private float[] calculateRotation(BlockPos targetPos) {
        return calculateRotationToLookDirection(); // Теперь используем новый метод
    }

    // Вспомогательный метод для проверки активности ротации
    public boolean isRotationActive() {
        return mode.is("spookytime") && rotation.getValue() && targetRotation != null && moveFix.getValue();
    }

    // СТАРЫЕ МЕТОДЫ ДЛЯ ДРУГИХ РЕЖИМОВ
    private void placeBlocks(EventMotion motion, int slot) {
        int last = mc.player.inventory.currentItem;
        mc.player.inventory.currentItem = slot;
        motion.setPitch(80);
        motion.setYaw(mc.player.getHorizontalFacing().getHorizontalAngle());
        BlockRayTraceResult r = (BlockRayTraceResult) MouseUtility.rayTrace(4, motion.getYaw(), motion.getPitch(), mc.player);

        if (mc.player.inventory.getStackInSlot(slot).getItem() == Items.WATER_BUCKET) {
            mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
        } else {
            mc.player.swingArm(Hand.MAIN_HAND);
            mc.playerController.processRightClickBlock(mc.player, mc.world, Hand.MAIN_HAND, r);
        }

        mc.player.inventory.currentItem = last;
        mc.player.fallDistance = 0;
    }

    public int getSlotInInventoryOrHotbar(boolean inHotBar) {
        int firstSlot = inHotBar ? 0 : 9;
        int lastSlot = inHotBar ? 9 : 36;
        int finalSlot = -1;

        for (int i = firstSlot; i < lastSlot; i++) {
            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.TORCH) {
                continue;
            }

            if (mc.player.inventory.getStackInSlot(i).getItem() instanceof BlockItem) {
                finalSlot = i;
                break;
            }
        }

        if (finalSlot == -1) {
            for (int i = firstSlot; i < lastSlot; i++) {
                if (mc.player.inventory.getStackInSlot(i).getItem() == Items.WATER_BUCKET) {
                    finalSlot = i;
                    break;
                }
            }
        }

        return finalSlot;
    }
}
мне было лень поэтому ctrl+c ctrl+v
не вижу смысла, gpt and not spider. Братишь это нихуя не спайдер, это тот же с блоками в регионах. Если бы байпас на чё то прям такое пиздатое то было бы нормас, а так говно код 400+ строк и gpt. /del
 
Пожалуйста, авторизуйтесь для просмотра ссылки.


JavaScript:
Expand Collapse Copy
package eva.ware.modules.impl.movement;

import com.google.common.eventbus.Subscribe;
import eva.ware.Evaware;
import eva.ware.events.EventMotion;
import eva.ware.events.EventPacket;
import eva.ware.events.EventUpdate;
import eva.ware.events.EventInput;
import eva.ware.modules.api.Category;
import eva.ware.modules.api.Module;
import eva.ware.modules.api.ModuleRegister;
import eva.ware.modules.settings.impl.CheckBoxSetting;
import eva.ware.modules.settings.impl.ModeSetting;
import eva.ware.modules.settings.impl.SliderSetting;
import eva.ware.utils.math.TimerUtility;
import eva.ware.utils.player.MouseUtility;
import eva.ware.utils.player.MoveUtility;
import eva.ware.utils.player.PlayerUtility;
import net.minecraft.block.BlockState;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.IPacket;
import net.minecraft.network.play.client.CEntityActionPacket;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.network.play.client.CPlayerTryUseItemPacket;
import net.minecraft.network.play.server.SEntityMetadataPacket;
import net.minecraft.network.play.server.SPlayerPositionLookPacket;
import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;

import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;

@ModuleRegister(name = "Spider", category = Category.Movement)
public class Spider extends Module {
    public ModeSetting mode = new ModeSetting("Mode", "Grim", "RW", "Grim", "Grim 2", "Matrix", "Elytra", "spookytime");
    private final SliderSetting spiderSpeed = new SliderSetting("Скорость", 2.0f, 1.0f, 10.0f, 0.05f).visibleIf(() -> mode.is("Matrix") || mode.is("RW"));
    private final CheckBoxSetting bypass = new CheckBoxSetting("Второй обход", true).visibleIf(() -> mode.is("Elytra"));

    // Настройки ротации для spookytime
    private final CheckBoxSetting rotation = new CheckBoxSetting("Ротация", true).visibleIf(() -> mode.is("spookytime"));
    private final CheckBoxSetting moveFix = new CheckBoxSetting("Коррекция движения", true).visibleIf(() -> mode.is("spookytime"));
    private final SliderSetting rotationPitch = new SliderSetting("Угол наклона", 45.0f, 0, 90, 1).visibleIf(() -> mode.is("spookytime") && rotation.getValue());

    TimerUtility timerUtility = new TimerUtility();
    TimerUtility blockPlaceDelay = new TimerUtility();

    int oldItem = -1;
    int oldItem1 = -1;
    int i;
    long speed;

    // Переменные для ротации
    private Vector2f targetRotation;
    private BlockPos currentTarget = null;

    // SpookyTime переменные
    private Timer timer = new Timer();
    private boolean canUse = true;
    private final Random random = new Random();

    public Spider() {
        addSettings(mode, bypass, spiderSpeed, rotation, moveFix, rotationPitch);
    }

    @Override
    public boolean onEnable() {
        super.onEnable();
        targetRotation = null;
        currentTarget = null;

        // Инициализация SpookyTime
        if (mode.is("spookytime")) {
            timer = new Timer();
            canUse = true;
            if (mc.gameSettings != null) {
                mc.gameSettings.keyBindSneak.setPressed(false);
            }
        }
        return false;
    }

    @Override
    public void onDisable() {
        super.onDisable();
        targetRotation = null;
        currentTarget = null;

        // Сброс SpookyTime при выключении
        if (mode.is("spookytime")) {
            timer.cancel();
            timer = new Timer();
            canUse = true;
            if (mc.gameSettings != null) {
                mc.gameSettings.keyBindSneak.setPressed(false);
                mc.gameSettings.keyBindJump.setPressed(false);
            }
        }

        // Сброс ротации при выключении
        if (moveFix.getValue() && mc.player != null) {
            mc.player.rotationYawOffset = Integer.MIN_VALUE;
        }
    }

    @Subscribe
    public void onMotion(EventMotion motion) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "RW" -> {
                // Реализация RW из предоставленного кода
                int bucketSlot = findBucketInInventory();
                if (bucketSlot != -1) {
                    if (mc.player.getHeldItemMainhand().getItem() != Items.WATER_BUCKET) {
                        mc.player.inventory.currentItem = bucketSlot;
                    }

                    if (mc.player.collidedHorizontally) {
                        mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
                        mc.player.setMotion(mc.player.getMotion().x, 0.36, mc.player.getMotion().z);
                    }
                }
            }
            case "Matrix" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                long speed = MathHelper.clamp(500 - (spiderSpeed.getValue().longValue() / 2 * 100), 0, 500);
                if (timerUtility.isReached(speed)) {
                    motion.setOnGround(true);
                    mc.player.setOnGround(true);
                    mc.player.collidedVertically = true;
                    mc.player.collidedHorizontally = true;
                    mc.player.isAirBorne = true;
                    mc.player.jump();
                    timerUtility.reset();
                }
            }
            case "Grim" -> {
                int slotInHotBar = getSlotInInventoryOrHotbar(true);

                if (slotInHotBar == -1) {
                    print("Блоки не найдены!");
                    toggle();
                    return;
                }
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (mc.player.isOnGround()) {
                    motion.setOnGround(true);
                    mc.player.setOnGround(true);
                    mc.player.jump();
                }
                if (mc.player.fallDistance > 0 && mc.player.fallDistance < 2) {
                    placeBlocks(motion, slotInHotBar);
                }
            }

            case "spookytime" -> {
                handleSpookyTimeMode(motion);
            }

            case "Grim 2" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (!mc.player.isOnGround()) {
                    speed = (long) MathHelper.clamp(500L - spiderSpeed.getValue() / 2L * 100L, 0L, 500L);
                    if (this.timerUtility.isReached(speed)) {
                        mc.gameSettings.keyBindSneak.setPressed(true);
                        motion.setOnGround(true);
                        mc.player.setOnGround(true);
                        mc.player.collidedVertically = true;
                        mc.player.collidedHorizontally = true;
                        mc.player.isAirBorne = true;
                        if (mc.player.fallDistance != 0.0F) {
                            mc.gameSettings.keyBindForward.setPressed(true);
                            mc.gameSettings.keyBindForward.setPressed(false);
                        }

                        if (!mc.player.movementInput.jump) mc.player.jump();
                        mc.gameSettings.keyBindSneak.setPressed(false);
                        this.timerUtility.reset();
                    }
                }
            }

            case "Elytra" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                motion.setPitch(0.0F);
                mc.player.rotationPitchHead = 0.0F;
            }
        }
    }

    // SpookyTime реализация из первого кода
    private void handleSpookyTimeMode(EventMotion motion) {
        if (mc.player == null || mc.player.isInWater()) {
            return;
        }

        // Отладочный вывод для проверки значений
        System.out.println("Rotation enabled: " + rotation.getValue());
        System.out.println("Current pitch setting: " + rotationPitch.getValue());

        // Устанавливаем ротацию если включена
        if (rotation.getValue()) {
            float[] rot = calculateRotationToLookDirection();
            targetRotation = new Vector2f(rot[0], rot[1]);

            motion.setYaw(targetRotation.x);
            motion.setPitch(targetRotation.y);

            // Обновляем голову игрока
            mc.player.rotationYawHead = targetRotation.x;
            mc.player.renderYawOffset = PlayerUtility.calculateCorrectYawOffset(targetRotation.x);
            mc.player.rotationPitchHead = targetRotation.y;

            // Отладочный вывод примененных значений
            System.out.println("Applied rotation - Yaw: " + targetRotation.x + ", Pitch: " + targetRotation.y);
        }

        if (!mc.player.collidedHorizontally) {
            if (mc.gameSettings.keyBindSneak.isKeyDown()) {
                mc.gameSettings.keyBindSneak.setPressed(false);
            }
            return;
        }

        int waterSlot = getWaterBucketSlot();
        if (waterSlot == -1) {
            print("Водное ведро не найдено!");
            toggle();
            return;
        }

        if (canUse) {
            int currentSlot = mc.player.inventory.currentItem;

            if (waterSlot != currentSlot) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(waterSlot));
            }

            mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(Hand.MAIN_HAND));

            if (waterSlot != currentSlot) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(currentSlot));
            }

            double yBoost = 0.42D + (random.nextDouble() * 0.02D);
            mc.player.motion.y = yBoost;

            canUse = false;
            timer.schedule(new TimerTask() {
                @Override
                public void run() {
                    canUse = true;
                }
            }, getAppliedDelayMs());
        }

        mc.gameSettings.keyBindSneak.setPressed(true);
    }

    private int getAppliedDelayMs() {
        float base = 0.45F;
        int ms = (int) (base * 1000.0F);
        int offset = random.nextInt(60) - 30;
        return Math.max(150, ms + offset);
    }

    @Subscribe
    public void onInput(EventInput e) {
        // Коррекция движения при включенной ротации в режиме spookytime
        if (mode.is("spookytime") && rotation.getValue() && moveFix.getValue() && targetRotation != null) {
            MoveUtility.fixMovement(e, targetRotation.x);
        }
    }

    @Subscribe
    public void onUpdate(EventUpdate e) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "Elytra" -> {
                if (!bypass.getValue()) {
                    if (!mc.player.collidedHorizontally) {
                        return;
                    }
                    for (i = 0; i < 9; ++i) {
                        if (mc.player.inventory.getStackInSlot(i).getItem() == Items.ELYTRA && !mc.player.isOnGround() && mc.player.collidedHorizontally && mc.player.fallDistance == 0.0F) {
                            mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                            mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.START_FALL_FLYING));
                            MoveUtility.setMotion(0.06);
                            mc.player.motion.y = 0.366;
                            mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                            this.oldItem = i;
                        }
                    }
                } else {
                    if ((mc.player.inventory.armorInventory.get(2)).getItem() != Items.ELYTRA && mc.player.collidedHorizontally) {
                        for(i = 0; i < 9; ++i) {
                            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.ELYTRA) {
                                mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                                this.oldItem1 = i;
                                this.timerUtility.reset();
                            }
                        }
                    }

                    if (mc.player.collidedHorizontally) {
                        mc.gameSettings.keyBindJump.setPressed(false);
                        if (this.timerUtility.isReached(180L)) {
                            mc.gameSettings.keyBindJump.setPressed(true);
                        }
                    }

                    if ((mc.player.inventory.armorInventory.get(2)).getItem() == Items.ELYTRA && !mc.player.collidedHorizontally && this.oldItem1 != -1) {
                        mc.playerController.windowClick(0, 6, this.oldItem1, ClickType.SWAP, mc.player);
                        this.oldItem1 = -1;
                    }

                    if ((mc.player.inventory.armorInventory.get(2)).getItem() == Items.ELYTRA && !mc.player.isOnGround() && mc.player.collidedHorizontally) {
                        if (mc.player.fallDistance != 0.0F) {
                            return;
                        }

                        mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.START_FALL_FLYING));
                        MoveUtility.setMotion(0.02);
                        mc.player.motion.y = 0.36;
                    }
                }
            }
        }
    }

    @Subscribe
    public void onPacket(EventPacket e) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "Elytra" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (!bypass.getValue()) {
                    IPacket iPacket = e.getPacket();
                    if (iPacket instanceof SPlayerPositionLookPacket) {
                        SPlayerPositionLookPacket p = (SPlayerPositionLookPacket) iPacket;
                        mc.player.func_242277_a(new Vector3d(p.getX(), p.getY(), p.getZ()));
                        mc.player.setRawPosition(p.getX(), p.getY(), p.getZ());
                        return;
                    }

                    if (e.getPacket() instanceof SEntityMetadataPacket && ((SEntityMetadataPacket) e.getPacket()).getEntityId() == mc.player.getEntityId()) {
                        e.cancel();
                    }
                } else {
                    if (e.getPacket() instanceof SEntityMetadataPacket && ((SEntityMetadataPacket) e.getPacket()).getEntityId() == mc.player.getEntityId()) {
                        e.cancel();
                    }
                }
            }
        }
    }

    // Метод для поиска ведра воды в инвентаре (из RW кода)
    private int findBucketInInventory() {
        for (int i = 0; i < 9; i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack != null && stack.getItem() == Items.WATER_BUCKET) {
                return i;
            }
        }
        return -1;
    }

    // ИСПРАВЛЕННЫЙ МЕТОД: РОТАЦИЯ В НАПРАВЛЕНИИ ВЗГЛЯДА ИГРОКА
    private float[] calculateRotationToLookDirection() {
        // Используем текущий yaw игрока
        float yaw = mc.player.rotationYaw;

        // ИСПРАВЛЕНИЕ: Используем значение из настройки rotationPitch
        float pitch = rotationPitch.getValue().floatValue();

        return new float[]{MathHelper.wrapDegrees(yaw), MathHelper.clamp(pitch, -90.0f, 90.0f)};
    }

    // Ищет водное ведро в хотбаре
    private int getWaterBucketSlot() {
        for (int i = 0; i < 9; i++) {
            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.WATER_BUCKET) {
                return i;
            }
        }
        return -1;
    }

    // Старый метод для расчета ротации на блок (оставлен для совместимости)
    private float[] calculateRotation(BlockPos targetPos) {
        return calculateRotationToLookDirection(); // Теперь используем новый метод
    }

    // Вспомогательный метод для проверки активности ротации
    public boolean isRotationActive() {
        return mode.is("spookytime") && rotation.getValue() && targetRotation != null && moveFix.getValue();
    }

    // СТАРЫЕ МЕТОДЫ ДЛЯ ДРУГИХ РЕЖИМОВ
    private void placeBlocks(EventMotion motion, int slot) {
        int last = mc.player.inventory.currentItem;
        mc.player.inventory.currentItem = slot;
        motion.setPitch(80);
        motion.setYaw(mc.player.getHorizontalFacing().getHorizontalAngle());
        BlockRayTraceResult r = (BlockRayTraceResult) MouseUtility.rayTrace(4, motion.getYaw(), motion.getPitch(), mc.player);

        if (mc.player.inventory.getStackInSlot(slot).getItem() == Items.WATER_BUCKET) {
            mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
        } else {
            mc.player.swingArm(Hand.MAIN_HAND);
            mc.playerController.processRightClickBlock(mc.player, mc.world, Hand.MAIN_HAND, r);
        }

        mc.player.inventory.currentItem = last;
        mc.player.fallDistance = 0;
    }

    public int getSlotInInventoryOrHotbar(boolean inHotBar) {
        int firstSlot = inHotBar ? 0 : 9;
        int lastSlot = inHotBar ? 9 : 36;
        int finalSlot = -1;

        for (int i = firstSlot; i < lastSlot; i++) {
            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.TORCH) {
                continue;
            }

            if (mc.player.inventory.getStackInSlot(i).getItem() instanceof BlockItem) {
                finalSlot = i;
                break;
            }
        }

        if (finalSlot == -1) {
            for (int i = firstSlot; i < lastSlot; i++) {
                if (mc.player.inventory.getStackInSlot(i).getItem() == Items.WATER_BUCKET) {
                    finalSlot = i;
                    break;
                }
            }
        }

        return finalSlot;
    }
}
мне было лень поэтому ctrl+c ctrl+v
давно есть на юге бро 😒
 
Пожалуйста, авторизуйтесь для просмотра ссылки.


JavaScript:
Expand Collapse Copy
package eva.ware.modules.impl.movement;

import com.google.common.eventbus.Subscribe;
import eva.ware.Evaware;
import eva.ware.events.EventMotion;
import eva.ware.events.EventPacket;
import eva.ware.events.EventUpdate;
import eva.ware.events.EventInput;
import eva.ware.modules.api.Category;
import eva.ware.modules.api.Module;
import eva.ware.modules.api.ModuleRegister;
import eva.ware.modules.settings.impl.CheckBoxSetting;
import eva.ware.modules.settings.impl.ModeSetting;
import eva.ware.modules.settings.impl.SliderSetting;
import eva.ware.utils.math.TimerUtility;
import eva.ware.utils.player.MouseUtility;
import eva.ware.utils.player.MoveUtility;
import eva.ware.utils.player.PlayerUtility;
import net.minecraft.block.BlockState;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.IPacket;
import net.minecraft.network.play.client.CEntityActionPacket;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.network.play.client.CPlayerTryUseItemPacket;
import net.minecraft.network.play.server.SEntityMetadataPacket;
import net.minecraft.network.play.server.SPlayerPositionLookPacket;
import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;

import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;

@ModuleRegister(name = "Spider", category = Category.Movement)
public class Spider extends Module {
    public ModeSetting mode = new ModeSetting("Mode", "Grim", "RW", "Grim", "Grim 2", "Matrix", "Elytra", "spookytime");
    private final SliderSetting spiderSpeed = new SliderSetting("Скорость", 2.0f, 1.0f, 10.0f, 0.05f).visibleIf(() -> mode.is("Matrix") || mode.is("RW"));
    private final CheckBoxSetting bypass = new CheckBoxSetting("Второй обход", true).visibleIf(() -> mode.is("Elytra"));

    // Настройки ротации для spookytime
    private final CheckBoxSetting rotation = new CheckBoxSetting("Ротация", true).visibleIf(() -> mode.is("spookytime"));
    private final CheckBoxSetting moveFix = new CheckBoxSetting("Коррекция движения", true).visibleIf(() -> mode.is("spookytime"));
    private final SliderSetting rotationPitch = new SliderSetting("Угол наклона", 45.0f, 0, 90, 1).visibleIf(() -> mode.is("spookytime") && rotation.getValue());

    TimerUtility timerUtility = new TimerUtility();
    TimerUtility blockPlaceDelay = new TimerUtility();

    int oldItem = -1;
    int oldItem1 = -1;
    int i;
    long speed;

    // Переменные для ротации
    private Vector2f targetRotation;
    private BlockPos currentTarget = null;

    // SpookyTime переменные
    private Timer timer = new Timer();
    private boolean canUse = true;
    private final Random random = new Random();

    public Spider() {
        addSettings(mode, bypass, spiderSpeed, rotation, moveFix, rotationPitch);
    }

    @Override
    public boolean onEnable() {
        super.onEnable();
        targetRotation = null;
        currentTarget = null;

        // Инициализация SpookyTime
        if (mode.is("spookytime")) {
            timer = new Timer();
            canUse = true;
            if (mc.gameSettings != null) {
                mc.gameSettings.keyBindSneak.setPressed(false);
            }
        }
        return false;
    }

    @Override
    public void onDisable() {
        super.onDisable();
        targetRotation = null;
        currentTarget = null;

        // Сброс SpookyTime при выключении
        if (mode.is("spookytime")) {
            timer.cancel();
            timer = new Timer();
            canUse = true;
            if (mc.gameSettings != null) {
                mc.gameSettings.keyBindSneak.setPressed(false);
                mc.gameSettings.keyBindJump.setPressed(false);
            }
        }

        // Сброс ротации при выключении
        if (moveFix.getValue() && mc.player != null) {
            mc.player.rotationYawOffset = Integer.MIN_VALUE;
        }
    }

    @Subscribe
    public void onMotion(EventMotion motion) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "RW" -> {
                // Реализация RW из предоставленного кода
                int bucketSlot = findBucketInInventory();
                if (bucketSlot != -1) {
                    if (mc.player.getHeldItemMainhand().getItem() != Items.WATER_BUCKET) {
                        mc.player.inventory.currentItem = bucketSlot;
                    }

                    if (mc.player.collidedHorizontally) {
                        mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
                        mc.player.setMotion(mc.player.getMotion().x, 0.36, mc.player.getMotion().z);
                    }
                }
            }
            case "Matrix" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                long speed = MathHelper.clamp(500 - (spiderSpeed.getValue().longValue() / 2 * 100), 0, 500);
                if (timerUtility.isReached(speed)) {
                    motion.setOnGround(true);
                    mc.player.setOnGround(true);
                    mc.player.collidedVertically = true;
                    mc.player.collidedHorizontally = true;
                    mc.player.isAirBorne = true;
                    mc.player.jump();
                    timerUtility.reset();
                }
            }
            case "Grim" -> {
                int slotInHotBar = getSlotInInventoryOrHotbar(true);

                if (slotInHotBar == -1) {
                    print("Блоки не найдены!");
                    toggle();
                    return;
                }
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (mc.player.isOnGround()) {
                    motion.setOnGround(true);
                    mc.player.setOnGround(true);
                    mc.player.jump();
                }
                if (mc.player.fallDistance > 0 && mc.player.fallDistance < 2) {
                    placeBlocks(motion, slotInHotBar);
                }
            }

            case "spookytime" -> {
                handleSpookyTimeMode(motion);
            }

            case "Grim 2" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (!mc.player.isOnGround()) {
                    speed = (long) MathHelper.clamp(500L - spiderSpeed.getValue() / 2L * 100L, 0L, 500L);
                    if (this.timerUtility.isReached(speed)) {
                        mc.gameSettings.keyBindSneak.setPressed(true);
                        motion.setOnGround(true);
                        mc.player.setOnGround(true);
                        mc.player.collidedVertically = true;
                        mc.player.collidedHorizontally = true;
                        mc.player.isAirBorne = true;
                        if (mc.player.fallDistance != 0.0F) {
                            mc.gameSettings.keyBindForward.setPressed(true);
                            mc.gameSettings.keyBindForward.setPressed(false);
                        }

                        if (!mc.player.movementInput.jump) mc.player.jump();
                        mc.gameSettings.keyBindSneak.setPressed(false);
                        this.timerUtility.reset();
                    }
                }
            }

            case "Elytra" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                motion.setPitch(0.0F);
                mc.player.rotationPitchHead = 0.0F;
            }
        }
    }

    // SpookyTime реализация из первого кода
    private void handleSpookyTimeMode(EventMotion motion) {
        if (mc.player == null || mc.player.isInWater()) {
            return;
        }

        // Отладочный вывод для проверки значений
        System.out.println("Rotation enabled: " + rotation.getValue());
        System.out.println("Current pitch setting: " + rotationPitch.getValue());

        // Устанавливаем ротацию если включена
        if (rotation.getValue()) {
            float[] rot = calculateRotationToLookDirection();
            targetRotation = new Vector2f(rot[0], rot[1]);

            motion.setYaw(targetRotation.x);
            motion.setPitch(targetRotation.y);

            // Обновляем голову игрока
            mc.player.rotationYawHead = targetRotation.x;
            mc.player.renderYawOffset = PlayerUtility.calculateCorrectYawOffset(targetRotation.x);
            mc.player.rotationPitchHead = targetRotation.y;

            // Отладочный вывод примененных значений
            System.out.println("Applied rotation - Yaw: " + targetRotation.x + ", Pitch: " + targetRotation.y);
        }

        if (!mc.player.collidedHorizontally) {
            if (mc.gameSettings.keyBindSneak.isKeyDown()) {
                mc.gameSettings.keyBindSneak.setPressed(false);
            }
            return;
        }

        int waterSlot = getWaterBucketSlot();
        if (waterSlot == -1) {
            print("Водное ведро не найдено!");
            toggle();
            return;
        }

        if (canUse) {
            int currentSlot = mc.player.inventory.currentItem;

            if (waterSlot != currentSlot) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(waterSlot));
            }

            mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(Hand.MAIN_HAND));

            if (waterSlot != currentSlot) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(currentSlot));
            }

            double yBoost = 0.42D + (random.nextDouble() * 0.02D);
            mc.player.motion.y = yBoost;

            canUse = false;
            timer.schedule(new TimerTask() {
                @Override
                public void run() {
                    canUse = true;
                }
            }, getAppliedDelayMs());
        }

        mc.gameSettings.keyBindSneak.setPressed(true);
    }

    private int getAppliedDelayMs() {
        float base = 0.45F;
        int ms = (int) (base * 1000.0F);
        int offset = random.nextInt(60) - 30;
        return Math.max(150, ms + offset);
    }

    @Subscribe
    public void onInput(EventInput e) {
        // Коррекция движения при включенной ротации в режиме spookytime
        if (mode.is("spookytime") && rotation.getValue() && moveFix.getValue() && targetRotation != null) {
            MoveUtility.fixMovement(e, targetRotation.x);
        }
    }

    @Subscribe
    public void onUpdate(EventUpdate e) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "Elytra" -> {
                if (!bypass.getValue()) {
                    if (!mc.player.collidedHorizontally) {
                        return;
                    }
                    for (i = 0; i < 9; ++i) {
                        if (mc.player.inventory.getStackInSlot(i).getItem() == Items.ELYTRA && !mc.player.isOnGround() && mc.player.collidedHorizontally && mc.player.fallDistance == 0.0F) {
                            mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                            mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.START_FALL_FLYING));
                            MoveUtility.setMotion(0.06);
                            mc.player.motion.y = 0.366;
                            mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                            this.oldItem = i;
                        }
                    }
                } else {
                    if ((mc.player.inventory.armorInventory.get(2)).getItem() != Items.ELYTRA && mc.player.collidedHorizontally) {
                        for(i = 0; i < 9; ++i) {
                            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.ELYTRA) {
                                mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                                this.oldItem1 = i;
                                this.timerUtility.reset();
                            }
                        }
                    }

                    if (mc.player.collidedHorizontally) {
                        mc.gameSettings.keyBindJump.setPressed(false);
                        if (this.timerUtility.isReached(180L)) {
                            mc.gameSettings.keyBindJump.setPressed(true);
                        }
                    }

                    if ((mc.player.inventory.armorInventory.get(2)).getItem() == Items.ELYTRA && !mc.player.collidedHorizontally && this.oldItem1 != -1) {
                        mc.playerController.windowClick(0, 6, this.oldItem1, ClickType.SWAP, mc.player);
                        this.oldItem1 = -1;
                    }

                    if ((mc.player.inventory.armorInventory.get(2)).getItem() == Items.ELYTRA && !mc.player.isOnGround() && mc.player.collidedHorizontally) {
                        if (mc.player.fallDistance != 0.0F) {
                            return;
                        }

                        mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.START_FALL_FLYING));
                        MoveUtility.setMotion(0.02);
                        mc.player.motion.y = 0.36;
                    }
                }
            }
        }
    }

    @Subscribe
    public void onPacket(EventPacket e) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "Elytra" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (!bypass.getValue()) {
                    IPacket iPacket = e.getPacket();
                    if (iPacket instanceof SPlayerPositionLookPacket) {
                        SPlayerPositionLookPacket p = (SPlayerPositionLookPacket) iPacket;
                        mc.player.func_242277_a(new Vector3d(p.getX(), p.getY(), p.getZ()));
                        mc.player.setRawPosition(p.getX(), p.getY(), p.getZ());
                        return;
                    }

                    if (e.getPacket() instanceof SEntityMetadataPacket && ((SEntityMetadataPacket) e.getPacket()).getEntityId() == mc.player.getEntityId()) {
                        e.cancel();
                    }
                } else {
                    if (e.getPacket() instanceof SEntityMetadataPacket && ((SEntityMetadataPacket) e.getPacket()).getEntityId() == mc.player.getEntityId()) {
                        e.cancel();
                    }
                }
            }
        }
    }

    // Метод для поиска ведра воды в инвентаре (из RW кода)
    private int findBucketInInventory() {
        for (int i = 0; i < 9; i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack != null && stack.getItem() == Items.WATER_BUCKET) {
                return i;
            }
        }
        return -1;
    }

    // ИСПРАВЛЕННЫЙ МЕТОД: РОТАЦИЯ В НАПРАВЛЕНИИ ВЗГЛЯДА ИГРОКА
    private float[] calculateRotationToLookDirection() {
        // Используем текущий yaw игрока
        float yaw = mc.player.rotationYaw;

        // ИСПРАВЛЕНИЕ: Используем значение из настройки rotationPitch
        float pitch = rotationPitch.getValue().floatValue();

        return new float[]{MathHelper.wrapDegrees(yaw), MathHelper.clamp(pitch, -90.0f, 90.0f)};
    }

    // Ищет водное ведро в хотбаре
    private int getWaterBucketSlot() {
        for (int i = 0; i < 9; i++) {
            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.WATER_BUCKET) {
                return i;
            }
        }
        return -1;
    }

    // Старый метод для расчета ротации на блок (оставлен для совместимости)
    private float[] calculateRotation(BlockPos targetPos) {
        return calculateRotationToLookDirection(); // Теперь используем новый метод
    }

    // Вспомогательный метод для проверки активности ротации
    public boolean isRotationActive() {
        return mode.is("spookytime") && rotation.getValue() && targetRotation != null && moveFix.getValue();
    }

    // СТАРЫЕ МЕТОДЫ ДЛЯ ДРУГИХ РЕЖИМОВ
    private void placeBlocks(EventMotion motion, int slot) {
        int last = mc.player.inventory.currentItem;
        mc.player.inventory.currentItem = slot;
        motion.setPitch(80);
        motion.setYaw(mc.player.getHorizontalFacing().getHorizontalAngle());
        BlockRayTraceResult r = (BlockRayTraceResult) MouseUtility.rayTrace(4, motion.getYaw(), motion.getPitch(), mc.player);

        if (mc.player.inventory.getStackInSlot(slot).getItem() == Items.WATER_BUCKET) {
            mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
        } else {
            mc.player.swingArm(Hand.MAIN_HAND);
            mc.playerController.processRightClickBlock(mc.player, mc.world, Hand.MAIN_HAND, r);
        }

        mc.player.inventory.currentItem = last;
        mc.player.fallDistance = 0;
    }

    public int getSlotInInventoryOrHotbar(boolean inHotBar) {
        int firstSlot = inHotBar ? 0 : 9;
        int lastSlot = inHotBar ? 9 : 36;
        int finalSlot = -1;

        for (int i = firstSlot; i < lastSlot; i++) {
            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.TORCH) {
                continue;
            }

            if (mc.player.inventory.getStackInSlot(i).getItem() instanceof BlockItem) {
                finalSlot = i;
                break;
            }
        }

        if (finalSlot == -1) {
            for (int i = firstSlot; i < lastSlot; i++) {
                if (mc.player.inventory.getStackInSlot(i).getItem() == Items.WATER_BUCKET) {
                    finalSlot = i;
                    break;
                }
            }
        }

        return finalSlot;
    }
}
мне было лень поэтому ctrl+c ctrl+v
niva recod не ну прям лучший спайдер спс спастил в астана длс
 
Пожалуйста, авторизуйтесь для просмотра ссылки.


JavaScript:
Expand Collapse Copy
package eva.ware.modules.impl.movement;

import com.google.common.eventbus.Subscribe;
import eva.ware.Evaware;
import eva.ware.events.EventMotion;
import eva.ware.events.EventPacket;
import eva.ware.events.EventUpdate;
import eva.ware.events.EventInput;
import eva.ware.modules.api.Category;
import eva.ware.modules.api.Module;
import eva.ware.modules.api.ModuleRegister;
import eva.ware.modules.settings.impl.CheckBoxSetting;
import eva.ware.modules.settings.impl.ModeSetting;
import eva.ware.modules.settings.impl.SliderSetting;
import eva.ware.utils.math.TimerUtility;
import eva.ware.utils.player.MouseUtility;
import eva.ware.utils.player.MoveUtility;
import eva.ware.utils.player.PlayerUtility;
import net.minecraft.block.BlockState;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.IPacket;
import net.minecraft.network.play.client.CEntityActionPacket;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.network.play.client.CPlayerTryUseItemPacket;
import net.minecraft.network.play.server.SEntityMetadataPacket;
import net.minecraft.network.play.server.SPlayerPositionLookPacket;
import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;

import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;

@ModuleRegister(name = "Spider", category = Category.Movement)
public class Spider extends Module {
    public ModeSetting mode = new ModeSetting("Mode", "Grim", "RW", "Grim", "Grim 2", "Matrix", "Elytra", "spookytime");
    private final SliderSetting spiderSpeed = new SliderSetting("Скорость", 2.0f, 1.0f, 10.0f, 0.05f).visibleIf(() -> mode.is("Matrix") || mode.is("RW"));
    private final CheckBoxSetting bypass = new CheckBoxSetting("Второй обход", true).visibleIf(() -> mode.is("Elytra"));

    // Настройки ротации для spookytime
    private final CheckBoxSetting rotation = new CheckBoxSetting("Ротация", true).visibleIf(() -> mode.is("spookytime"));
    private final CheckBoxSetting moveFix = new CheckBoxSetting("Коррекция движения", true).visibleIf(() -> mode.is("spookytime"));
    private final SliderSetting rotationPitch = new SliderSetting("Угол наклона", 45.0f, 0, 90, 1).visibleIf(() -> mode.is("spookytime") && rotation.getValue());

    TimerUtility timerUtility = new TimerUtility();
    TimerUtility blockPlaceDelay = new TimerUtility();

    int oldItem = -1;
    int oldItem1 = -1;
    int i;
    long speed;

    // Переменные для ротации
    private Vector2f targetRotation;
    private BlockPos currentTarget = null;

    // SpookyTime переменные
    private Timer timer = new Timer();
    private boolean canUse = true;
    private final Random random = new Random();

    public Spider() {
        addSettings(mode, bypass, spiderSpeed, rotation, moveFix, rotationPitch);
    }

    @Override
    public boolean onEnable() {
        super.onEnable();
        targetRotation = null;
        currentTarget = null;

        // Инициализация SpookyTime
        if (mode.is("spookytime")) {
            timer = new Timer();
            canUse = true;
            if (mc.gameSettings != null) {
                mc.gameSettings.keyBindSneak.setPressed(false);
            }
        }
        return false;
    }

    @Override
    public void onDisable() {
        super.onDisable();
        targetRotation = null;
        currentTarget = null;

        // Сброс SpookyTime при выключении
        if (mode.is("spookytime")) {
            timer.cancel();
            timer = new Timer();
            canUse = true;
            if (mc.gameSettings != null) {
                mc.gameSettings.keyBindSneak.setPressed(false);
                mc.gameSettings.keyBindJump.setPressed(false);
            }
        }

        // Сброс ротации при выключении
        if (moveFix.getValue() && mc.player != null) {
            mc.player.rotationYawOffset = Integer.MIN_VALUE;
        }
    }

    @Subscribe
    public void onMotion(EventMotion motion) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "RW" -> {
                // Реализация RW из предоставленного кода
                int bucketSlot = findBucketInInventory();
                if (bucketSlot != -1) {
                    if (mc.player.getHeldItemMainhand().getItem() != Items.WATER_BUCKET) {
                        mc.player.inventory.currentItem = bucketSlot;
                    }

                    if (mc.player.collidedHorizontally) {
                        mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
                        mc.player.setMotion(mc.player.getMotion().x, 0.36, mc.player.getMotion().z);
                    }
                }
            }
            case "Matrix" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                long speed = MathHelper.clamp(500 - (spiderSpeed.getValue().longValue() / 2 * 100), 0, 500);
                if (timerUtility.isReached(speed)) {
                    motion.setOnGround(true);
                    mc.player.setOnGround(true);
                    mc.player.collidedVertically = true;
                    mc.player.collidedHorizontally = true;
                    mc.player.isAirBorne = true;
                    mc.player.jump();
                    timerUtility.reset();
                }
            }
            case "Grim" -> {
                int slotInHotBar = getSlotInInventoryOrHotbar(true);

                if (slotInHotBar == -1) {
                    print("Блоки не найдены!");
                    toggle();
                    return;
                }
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (mc.player.isOnGround()) {
                    motion.setOnGround(true);
                    mc.player.setOnGround(true);
                    mc.player.jump();
                }
                if (mc.player.fallDistance > 0 && mc.player.fallDistance < 2) {
                    placeBlocks(motion, slotInHotBar);
                }
            }

            case "spookytime" -> {
                handleSpookyTimeMode(motion);
            }

            case "Grim 2" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (!mc.player.isOnGround()) {
                    speed = (long) MathHelper.clamp(500L - spiderSpeed.getValue() / 2L * 100L, 0L, 500L);
                    if (this.timerUtility.isReached(speed)) {
                        mc.gameSettings.keyBindSneak.setPressed(true);
                        motion.setOnGround(true);
                        mc.player.setOnGround(true);
                        mc.player.collidedVertically = true;
                        mc.player.collidedHorizontally = true;
                        mc.player.isAirBorne = true;
                        if (mc.player.fallDistance != 0.0F) {
                            mc.gameSettings.keyBindForward.setPressed(true);
                            mc.gameSettings.keyBindForward.setPressed(false);
                        }

                        if (!mc.player.movementInput.jump) mc.player.jump();
                        mc.gameSettings.keyBindSneak.setPressed(false);
                        this.timerUtility.reset();
                    }
                }
            }

            case "Elytra" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                motion.setPitch(0.0F);
                mc.player.rotationPitchHead = 0.0F;
            }
        }
    }

    // SpookyTime реализация из первого кода
    private void handleSpookyTimeMode(EventMotion motion) {
        if (mc.player == null || mc.player.isInWater()) {
            return;
        }

        // Отладочный вывод для проверки значений
        System.out.println("Rotation enabled: " + rotation.getValue());
        System.out.println("Current pitch setting: " + rotationPitch.getValue());

        // Устанавливаем ротацию если включена
        if (rotation.getValue()) {
            float[] rot = calculateRotationToLookDirection();
            targetRotation = new Vector2f(rot[0], rot[1]);

            motion.setYaw(targetRotation.x);
            motion.setPitch(targetRotation.y);

            // Обновляем голову игрока
            mc.player.rotationYawHead = targetRotation.x;
            mc.player.renderYawOffset = PlayerUtility.calculateCorrectYawOffset(targetRotation.x);
            mc.player.rotationPitchHead = targetRotation.y;

            // Отладочный вывод примененных значений
            System.out.println("Applied rotation - Yaw: " + targetRotation.x + ", Pitch: " + targetRotation.y);
        }

        if (!mc.player.collidedHorizontally) {
            if (mc.gameSettings.keyBindSneak.isKeyDown()) {
                mc.gameSettings.keyBindSneak.setPressed(false);
            }
            return;
        }

        int waterSlot = getWaterBucketSlot();
        if (waterSlot == -1) {
            print("Водное ведро не найдено!");
            toggle();
            return;
        }

        if (canUse) {
            int currentSlot = mc.player.inventory.currentItem;

            if (waterSlot != currentSlot) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(waterSlot));
            }

            mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(Hand.MAIN_HAND));

            if (waterSlot != currentSlot) {
                mc.player.connection.sendPacket(new CHeldItemChangePacket(currentSlot));
            }

            double yBoost = 0.42D + (random.nextDouble() * 0.02D);
            mc.player.motion.y = yBoost;

            canUse = false;
            timer.schedule(new TimerTask() {
                @Override
                public void run() {
                    canUse = true;
                }
            }, getAppliedDelayMs());
        }

        mc.gameSettings.keyBindSneak.setPressed(true);
    }

    private int getAppliedDelayMs() {
        float base = 0.45F;
        int ms = (int) (base * 1000.0F);
        int offset = random.nextInt(60) - 30;
        return Math.max(150, ms + offset);
    }

    @Subscribe
    public void onInput(EventInput e) {
        // Коррекция движения при включенной ротации в режиме spookytime
        if (mode.is("spookytime") && rotation.getValue() && moveFix.getValue() && targetRotation != null) {
            MoveUtility.fixMovement(e, targetRotation.x);
        }
    }

    @Subscribe
    public void onUpdate(EventUpdate e) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "Elytra" -> {
                if (!bypass.getValue()) {
                    if (!mc.player.collidedHorizontally) {
                        return;
                    }
                    for (i = 0; i < 9; ++i) {
                        if (mc.player.inventory.getStackInSlot(i).getItem() == Items.ELYTRA && !mc.player.isOnGround() && mc.player.collidedHorizontally && mc.player.fallDistance == 0.0F) {
                            mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                            mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.START_FALL_FLYING));
                            MoveUtility.setMotion(0.06);
                            mc.player.motion.y = 0.366;
                            mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                            this.oldItem = i;
                        }
                    }
                } else {
                    if ((mc.player.inventory.armorInventory.get(2)).getItem() != Items.ELYTRA && mc.player.collidedHorizontally) {
                        for(i = 0; i < 9; ++i) {
                            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.ELYTRA) {
                                mc.playerController.windowClick(0, 6, i, ClickType.SWAP, mc.player);
                                this.oldItem1 = i;
                                this.timerUtility.reset();
                            }
                        }
                    }

                    if (mc.player.collidedHorizontally) {
                        mc.gameSettings.keyBindJump.setPressed(false);
                        if (this.timerUtility.isReached(180L)) {
                            mc.gameSettings.keyBindJump.setPressed(true);
                        }
                    }

                    if ((mc.player.inventory.armorInventory.get(2)).getItem() == Items.ELYTRA && !mc.player.collidedHorizontally && this.oldItem1 != -1) {
                        mc.playerController.windowClick(0, 6, this.oldItem1, ClickType.SWAP, mc.player);
                        this.oldItem1 = -1;
                    }

                    if ((mc.player.inventory.armorInventory.get(2)).getItem() == Items.ELYTRA && !mc.player.isOnGround() && mc.player.collidedHorizontally) {
                        if (mc.player.fallDistance != 0.0F) {
                            return;
                        }

                        mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.START_FALL_FLYING));
                        MoveUtility.setMotion(0.02);
                        mc.player.motion.y = 0.36;
                    }
                }
            }
        }
    }

    @Subscribe
    public void onPacket(EventPacket e) {
        if (Evaware.getInst().getModuleManager().getFreeCam().isEnabled()) return;

        switch (mode.getValue()) {
            case "Elytra" -> {
                if (!mc.player.collidedHorizontally) {
                    return;
                }
                if (!bypass.getValue()) {
                    IPacket iPacket = e.getPacket();
                    if (iPacket instanceof SPlayerPositionLookPacket) {
                        SPlayerPositionLookPacket p = (SPlayerPositionLookPacket) iPacket;
                        mc.player.func_242277_a(new Vector3d(p.getX(), p.getY(), p.getZ()));
                        mc.player.setRawPosition(p.getX(), p.getY(), p.getZ());
                        return;
                    }

                    if (e.getPacket() instanceof SEntityMetadataPacket && ((SEntityMetadataPacket) e.getPacket()).getEntityId() == mc.player.getEntityId()) {
                        e.cancel();
                    }
                } else {
                    if (e.getPacket() instanceof SEntityMetadataPacket && ((SEntityMetadataPacket) e.getPacket()).getEntityId() == mc.player.getEntityId()) {
                        e.cancel();
                    }
                }
            }
        }
    }

    // Метод для поиска ведра воды в инвентаре (из RW кода)
    private int findBucketInInventory() {
        for (int i = 0; i < 9; i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack != null && stack.getItem() == Items.WATER_BUCKET) {
                return i;
            }
        }
        return -1;
    }

    // ИСПРАВЛЕННЫЙ МЕТОД: РОТАЦИЯ В НАПРАВЛЕНИИ ВЗГЛЯДА ИГРОКА
    private float[] calculateRotationToLookDirection() {
        // Используем текущий yaw игрока
        float yaw = mc.player.rotationYaw;

        // ИСПРАВЛЕНИЕ: Используем значение из настройки rotationPitch
        float pitch = rotationPitch.getValue().floatValue();

        return new float[]{MathHelper.wrapDegrees(yaw), MathHelper.clamp(pitch, -90.0f, 90.0f)};
    }

    // Ищет водное ведро в хотбаре
    private int getWaterBucketSlot() {
        for (int i = 0; i < 9; i++) {
            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.WATER_BUCKET) {
                return i;
            }
        }
        return -1;
    }

    // Старый метод для расчета ротации на блок (оставлен для совместимости)
    private float[] calculateRotation(BlockPos targetPos) {
        return calculateRotationToLookDirection(); // Теперь используем новый метод
    }

    // Вспомогательный метод для проверки активности ротации
    public boolean isRotationActive() {
        return mode.is("spookytime") && rotation.getValue() && targetRotation != null && moveFix.getValue();
    }

    // СТАРЫЕ МЕТОДЫ ДЛЯ ДРУГИХ РЕЖИМОВ
    private void placeBlocks(EventMotion motion, int slot) {
        int last = mc.player.inventory.currentItem;
        mc.player.inventory.currentItem = slot;
        motion.setPitch(80);
        motion.setYaw(mc.player.getHorizontalFacing().getHorizontalAngle());
        BlockRayTraceResult r = (BlockRayTraceResult) MouseUtility.rayTrace(4, motion.getYaw(), motion.getPitch(), mc.player);

        if (mc.player.inventory.getStackInSlot(slot).getItem() == Items.WATER_BUCKET) {
            mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
        } else {
            mc.player.swingArm(Hand.MAIN_HAND);
            mc.playerController.processRightClickBlock(mc.player, mc.world, Hand.MAIN_HAND, r);
        }

        mc.player.inventory.currentItem = last;
        mc.player.fallDistance = 0;
    }

    public int getSlotInInventoryOrHotbar(boolean inHotBar) {
        int firstSlot = inHotBar ? 0 : 9;
        int lastSlot = inHotBar ? 9 : 36;
        int finalSlot = -1;

        for (int i = firstSlot; i < lastSlot; i++) {
            if (mc.player.inventory.getStackInSlot(i).getItem() == Items.TORCH) {
                continue;
            }

            if (mc.player.inventory.getStackInSlot(i).getItem() instanceof BlockItem) {
                finalSlot = i;
                break;
            }
        }

        if (finalSlot == -1) {
            for (int i = firstSlot; i < lastSlot; i++) {
                if (mc.player.inventory.getStackInSlot(i).getItem() == Items.WATER_BUCKET) {
                    finalSlot = i;
                    break;
                }
            }
        }

        return finalSlot;
    }
}
мне было лень поэтому ctrl+c ctrl+v
еблан? в кд не будет работать
 
братан я вахуе, взял код спайдера с найта ластового, залил в гпт сказав перенести на твою базу, получил говнокод на 500 строк и гордишься этим?
братан я вахуе, взял код спайдера с найта ластового, залил в гпт сказав перенести на твою базу, получил говнокод на 500 строк и гордишься этим?
не кидай такое больше сюда, пожалуйста
 

не вижу смысла, gpt and not spider. Братишь это нихуя не спайдер, это тот же с блоками в регионах. Если бы байпас на чё то прям такое пиздатое то было бы нормас, а так говно код 400+ строк и gpt. /del
Ладна пошел без ЛГБТ чат делать самому
 
Назад
Сверху Снизу