Исходник Expensive 4.0 | ClickPearl FIX

Начинающий
Статус
Оффлайн
Регистрация
11 Дек 2022
Сообщения
10
Реакции[?]
0
Поинты[?]
0

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

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

Спасибо!

Фикс клик перл в сурсах экспы 4.0

ClickPearlModule:
package ru.expensive.implement.features.modules.player;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.item.EnderPearlItem;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket;
import net.minecraft.util.Hand;
import org.lwjgl.glfw.GLFW;
import ru.expensive.api.event.EventHandler;
import ru.expensive.api.feature.module.Module;
import ru.expensive.api.feature.module.ModuleCategory;
import ru.expensive.common.util.math.Counter;
import ru.expensive.common.util.player.PlayerInventoryUtil;
import ru.expensive.common.util.task.TaskPriority;
import ru.expensive.implement.events.keyboard.KeyEvent;
import ru.expensive.implement.events.player.TickEvent;
import ru.expensive.implement.features.modules.combat.killaura.rotation.Angle;
import ru.expensive.implement.features.modules.combat.killaura.rotation.RotationConfig;
import ru.expensive.implement.features.modules.combat.killaura.rotation.RotationController;

@FieldDefaults(level = AccessLevel.PRIVATE)
@SuppressWarnings("all")
public class ClickPearlModule extends Module {
    Counter counter = Counter.create();
    Runnable keyPressedAction;

    public Action action = Action.START;

    public ClickPearlModule() {
        super("ClickPearl", ModuleCategory.PLAYER);
    }

    @EventHandler
    public void onKey(KeyEvent keyEvent) {
        if (keyEvent.isMouseButtonDown(GLFW.GLFW_MOUSE_BUTTON_MIDDLE) && canPerformAction()) {
            action = Action.START;
            keyPressedAction = () -> performAction();
            counter.resetCounter();
        }
    }

    @EventHandler
    public void onTick(TickEvent tickEvent) {
        if (keyPressedAction != null) {
            keyPressedAction.run();
        }
    }

    private boolean canPerformAction() {
        return keyPressedAction == null && !mc.player.getItemCooldownManager().isCoolingDown(Items.ENDER_PEARL);
    }

    private void startAction() {
        action = Action.START;
        keyPressedAction = () -> performAction();
        counter.resetCounter();
    }

    private void performAction() {
        RotationController rotationController = RotationController.INSTANCE;

        Integer slot = PlayerInventoryUtil.INSTANCE.findHotbarSlot(Items.ENDER_PEARL);
        Hand hand = mc.player.getOffHandStack().getItem() instanceof EnderPearlItem ? Hand.OFF_HAND : Hand.MAIN_HAND;

        if (slot != null) {
            if (rotationController.getCurrentRotationPlan() != null) {
                interactWithRotation(slot, hand, rotationController);
            } else {
                interact(slot, hand);
            }
        } else {
            keyPressedAction = null;
        }
    }

    private void interactWithRotation(Integer slot, Hand hand, RotationController rotationController) {
        if (action == Action.START) {
            rotationController.rotateTo(new Angle(mc.player.getYaw(), mc.player.getPitch()),
                    RotationConfig.DEFAULT,
                    TaskPriority.HIGH_IMPORTANCE_2, this);
            switchSlotIfNeeded(slot, slot, hand);
            action = Action.WAIT;
        } else if (action == Action.WAIT && counter.isReached(70L)) {
            action = Action.USE_ITEM;
        } else if (action == Action.USE_ITEM) {
            interactWithItem(hand);
            switchSlotIfNeeded(mc.player.getInventory().selectedSlot, slot, hand);
            keyPressedAction = null;
        }
    }

    private void interact(Integer slot, Hand hand) {
        if (action == Action.START) {
            switchSlotIfNeeded(slot, slot, hand);
            action = Action.WAIT;
        } else if (action == Action.WAIT && counter.isReached(50L)) {
            action = Action.USE_ITEM;
        } else if (action == Action.USE_ITEM) {
            interactWithItem(hand);
            switchSlotIfNeeded(mc.player.getInventory().selectedSlot, slot, hand);
            keyPressedAction = null;
        }
    }

    private void switchSlotIfNeeded(Integer swapSlot, Integer slot, Hand hand) {
        if (slot != mc.player.getInventory().selectedSlot && hand != Hand.OFF_HAND) {
            mc.player.networkHandler.sendPacket(new UpdateSelectedSlotC2SPacket(swapSlot));
        }
    }

    private void interactWithItem(Hand hand) {
        mc.interactionManager.sendSequencedPacket(mc.world, sequence -> new PlayerInteractItemC2SPacket(hand, sequence));
        mc.player.swingHand(hand);
    }

    public enum Action {
        START, WAIT, USE_ITEM
    }
}
 
Забаненный
Статус
Оффлайн
Регистрация
10 Май 2023
Сообщения
825
Реакции[?]
9
Поинты[?]
3K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
пон
 
Начинающий
Статус
Онлайн
Регистрация
13 Июл 2023
Сообщения
34
Реакции[?]
0
Поинты[?]
0
Фикс клик перл в сурсах экспы 4.0

ClickPearlModule:
package ru.expensive.implement.features.modules.player;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.item.EnderPearlItem;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket;
import net.minecraft.util.Hand;
import org.lwjgl.glfw.GLFW;
import ru.expensive.api.event.EventHandler;
import ru.expensive.api.feature.module.Module;
import ru.expensive.api.feature.module.ModuleCategory;
import ru.expensive.common.util.math.Counter;
import ru.expensive.common.util.player.PlayerInventoryUtil;
import ru.expensive.common.util.task.TaskPriority;
import ru.expensive.implement.events.keyboard.KeyEvent;
import ru.expensive.implement.events.player.TickEvent;
import ru.expensive.implement.features.modules.combat.killaura.rotation.Angle;
import ru.expensive.implement.features.modules.combat.killaura.rotation.RotationConfig;
import ru.expensive.implement.features.modules.combat.killaura.rotation.RotationController;

@FieldDefaults(level = AccessLevel.PRIVATE)
@SuppressWarnings("all")
public class ClickPearlModule extends Module {
    Counter counter = Counter.create();
    Runnable keyPressedAction;

    public Action action = Action.START;

    public ClickPearlModule() {
        super("ClickPearl", ModuleCategory.PLAYER);
    }

    @EventHandler
    public void onKey(KeyEvent keyEvent) {
        if (keyEvent.isMouseButtonDown(GLFW.GLFW_MOUSE_BUTTON_MIDDLE) && canPerformAction()) {
            action = Action.START;
            keyPressedAction = () -> performAction();
            counter.resetCounter();
        }
    }

    @EventHandler
    public void onTick(TickEvent tickEvent) {
        if (keyPressedAction != null) {
            keyPressedAction.run();
        }
    }

    private boolean canPerformAction() {
        return keyPressedAction == null && !mc.player.getItemCooldownManager().isCoolingDown(Items.ENDER_PEARL);
    }

    private void startAction() {
        action = Action.START;
        keyPressedAction = () -> performAction();
        counter.resetCounter();
    }

    private void performAction() {
        RotationController rotationController = RotationController.INSTANCE;

        Integer slot = PlayerInventoryUtil.INSTANCE.findHotbarSlot(Items.ENDER_PEARL);
        Hand hand = mc.player.getOffHandStack().getItem() instanceof EnderPearlItem ? Hand.OFF_HAND : Hand.MAIN_HAND;

        if (slot != null) {
            if (rotationController.getCurrentRotationPlan() != null) {
                interactWithRotation(slot, hand, rotationController);
            } else {
                interact(slot, hand);
            }
        } else {
            keyPressedAction = null;
        }
    }

    private void interactWithRotation(Integer slot, Hand hand, RotationController rotationController) {
        if (action == Action.START) {
            rotationController.rotateTo(new Angle(mc.player.getYaw(), mc.player.getPitch()),
                    RotationConfig.DEFAULT,
                    TaskPriority.HIGH_IMPORTANCE_2, this);
            switchSlotIfNeeded(slot, slot, hand);
            action = Action.WAIT;
        } else if (action == Action.WAIT && counter.isReached(70L)) {
            action = Action.USE_ITEM;
        } else if (action == Action.USE_ITEM) {
            interactWithItem(hand);
            switchSlotIfNeeded(mc.player.getInventory().selectedSlot, slot, hand);
            keyPressedAction = null;
        }
    }

    private void interact(Integer slot, Hand hand) {
        if (action == Action.START) {
            switchSlotIfNeeded(slot, slot, hand);
            action = Action.WAIT;
        } else if (action == Action.WAIT && counter.isReached(50L)) {
            action = Action.USE_ITEM;
        } else if (action == Action.USE_ITEM) {
            interactWithItem(hand);
            switchSlotIfNeeded(mc.player.getInventory().selectedSlot, slot, hand);
            keyPressedAction = null;
        }
    }

    private void switchSlotIfNeeded(Integer swapSlot, Integer slot, Hand hand) {
        if (slot != mc.player.getInventory().selectedSlot && hand != Hand.OFF_HAND) {
            mc.player.networkHandler.sendPacket(new UpdateSelectedSlotC2SPacket(swapSlot));
        }
    }

    private void interactWithItem(Hand hand) {
        mc.interactionManager.sendSequencedPacket(mc.world, sequence -> new PlayerInteractItemC2SPacket(hand, sequence));
        mc.player.swingHand(hand);
    }

    public enum Action {
        START, WAIT, USE_ITEM
    }
}
сливай тепер побольше таких тем
 
Начинающий
Статус
Оффлайн
Регистрация
23 Авг 2023
Сообщения
40
Реакции[?]
6
Поинты[?]
6K
сделай самое легкое swing animations или jumpcircle тк если ты заметил то в src Категория RENDER не робит.
 
Забаненный
Статус
Оффлайн
Регистрация
2 Фев 2024
Сообщения
849
Реакции[?]
7
Поинты[?]
4K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Фикс клик перл в сурсах экспы 4.0

ClickPearlModule:
package ru.expensive.implement.features.modules.player;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.item.EnderPearlItem;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket;
import net.minecraft.util.Hand;
import org.lwjgl.glfw.GLFW;
import ru.expensive.api.event.EventHandler;
import ru.expensive.api.feature.module.Module;
import ru.expensive.api.feature.module.ModuleCategory;
import ru.expensive.common.util.math.Counter;
import ru.expensive.common.util.player.PlayerInventoryUtil;
import ru.expensive.common.util.task.TaskPriority;
import ru.expensive.implement.events.keyboard.KeyEvent;
import ru.expensive.implement.events.player.TickEvent;
import ru.expensive.implement.features.modules.combat.killaura.rotation.Angle;
import ru.expensive.implement.features.modules.combat.killaura.rotation.RotationConfig;
import ru.expensive.implement.features.modules.combat.killaura.rotation.RotationController;

@FieldDefaults(level = AccessLevel.PRIVATE)
@SuppressWarnings("all")
public class ClickPearlModule extends Module {
    Counter counter = Counter.create();
    Runnable keyPressedAction;

    public Action action = Action.START;

    public ClickPearlModule() {
        super("ClickPearl", ModuleCategory.PLAYER);
    }

    @EventHandler
    public void onKey(KeyEvent keyEvent) {
        if (keyEvent.isMouseButtonDown(GLFW.GLFW_MOUSE_BUTTON_MIDDLE) && canPerformAction()) {
            action = Action.START;
            keyPressedAction = () -> performAction();
            counter.resetCounter();
        }
    }

    @EventHandler
    public void onTick(TickEvent tickEvent) {
        if (keyPressedAction != null) {
            keyPressedAction.run();
        }
    }

    private boolean canPerformAction() {
        return keyPressedAction == null && !mc.player.getItemCooldownManager().isCoolingDown(Items.ENDER_PEARL);
    }

    private void startAction() {
        action = Action.START;
        keyPressedAction = () -> performAction();
        counter.resetCounter();
    }

    private void performAction() {
        RotationController rotationController = RotationController.INSTANCE;

        Integer slot = PlayerInventoryUtil.INSTANCE.findHotbarSlot(Items.ENDER_PEARL);
        Hand hand = mc.player.getOffHandStack().getItem() instanceof EnderPearlItem ? Hand.OFF_HAND : Hand.MAIN_HAND;

        if (slot != null) {
            if (rotationController.getCurrentRotationPlan() != null) {
                interactWithRotation(slot, hand, rotationController);
            } else {
                interact(slot, hand);
            }
        } else {
            keyPressedAction = null;
        }
    }

    private void interactWithRotation(Integer slot, Hand hand, RotationController rotationController) {
        if (action == Action.START) {
            rotationController.rotateTo(new Angle(mc.player.getYaw(), mc.player.getPitch()),
                    RotationConfig.DEFAULT,
                    TaskPriority.HIGH_IMPORTANCE_2, this);
            switchSlotIfNeeded(slot, slot, hand);
            action = Action.WAIT;
        } else if (action == Action.WAIT && counter.isReached(70L)) {
            action = Action.USE_ITEM;
        } else if (action == Action.USE_ITEM) {
            interactWithItem(hand);
            switchSlotIfNeeded(mc.player.getInventory().selectedSlot, slot, hand);
            keyPressedAction = null;
        }
    }

    private void interact(Integer slot, Hand hand) {
        if (action == Action.START) {
            switchSlotIfNeeded(slot, slot, hand);
            action = Action.WAIT;
        } else if (action == Action.WAIT && counter.isReached(50L)) {
            action = Action.USE_ITEM;
        } else if (action == Action.USE_ITEM) {
            interactWithItem(hand);
            switchSlotIfNeeded(mc.player.getInventory().selectedSlot, slot, hand);
            keyPressedAction = null;
        }
    }

    private void switchSlotIfNeeded(Integer swapSlot, Integer slot, Hand hand) {
        if (slot != mc.player.getInventory().selectedSlot && hand != Hand.OFF_HAND) {
            mc.player.networkHandler.sendPacket(new UpdateSelectedSlotC2SPacket(swapSlot));
        }
    }

    private void interactWithItem(Hand hand) {
        mc.interactionManager.sendSequencedPacket(mc.world, sequence -> new PlayerInteractItemC2SPacket(hand, sequence));
        mc.player.swingHand(hand);
    }

    public enum Action {
        START, WAIT, USE_ITEM
    }
}
какой тут фикс это же стандарт заменил кнопку
 
Начинающий
Статус
Оффлайн
Регистрация
10 Июл 2023
Сообщения
211
Реакции[?]
2
Поинты[?]
1K
Фикс клик перл в сурсах экспы 4.0

ClickPearlModule:
package ru.expensive.implement.features.modules.player;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.item.EnderPearlItem;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket;
import net.minecraft.util.Hand;
import org.lwjgl.glfw.GLFW;
import ru.expensive.api.event.EventHandler;
import ru.expensive.api.feature.module.Module;
import ru.expensive.api.feature.module.ModuleCategory;
import ru.expensive.common.util.math.Counter;
import ru.expensive.common.util.player.PlayerInventoryUtil;
import ru.expensive.common.util.task.TaskPriority;
import ru.expensive.implement.events.keyboard.KeyEvent;
import ru.expensive.implement.events.player.TickEvent;
import ru.expensive.implement.features.modules.combat.killaura.rotation.Angle;
import ru.expensive.implement.features.modules.combat.killaura.rotation.RotationConfig;
import ru.expensive.implement.features.modules.combat.killaura.rotation.RotationController;

@FieldDefaults(level = AccessLevel.PRIVATE)
@SuppressWarnings("all")
public class ClickPearlModule extends Module {
    Counter counter = Counter.create();
    Runnable keyPressedAction;

    public Action action = Action.START;

    public ClickPearlModule() {
        super("ClickPearl", ModuleCategory.PLAYER);
    }

    @EventHandler
    public void onKey(KeyEvent keyEvent) {
        if (keyEvent.isMouseButtonDown(GLFW.GLFW_MOUSE_BUTTON_MIDDLE) && canPerformAction()) {
            action = Action.START;
            keyPressedAction = () -> performAction();
            counter.resetCounter();
        }
    }

    @EventHandler
    public void onTick(TickEvent tickEvent) {
        if (keyPressedAction != null) {
            keyPressedAction.run();
        }
    }

    private boolean canPerformAction() {
        return keyPressedAction == null && !mc.player.getItemCooldownManager().isCoolingDown(Items.ENDER_PEARL);
    }

    private void startAction() {
        action = Action.START;
        keyPressedAction = () -> performAction();
        counter.resetCounter();
    }

    private void performAction() {
        RotationController rotationController = RotationController.INSTANCE;

        Integer slot = PlayerInventoryUtil.INSTANCE.findHotbarSlot(Items.ENDER_PEARL);
        Hand hand = mc.player.getOffHandStack().getItem() instanceof EnderPearlItem ? Hand.OFF_HAND : Hand.MAIN_HAND;

        if (slot != null) {
            if (rotationController.getCurrentRotationPlan() != null) {
                interactWithRotation(slot, hand, rotationController);
            } else {
                interact(slot, hand);
            }
        } else {
            keyPressedAction = null;
        }
    }

    private void interactWithRotation(Integer slot, Hand hand, RotationController rotationController) {
        if (action == Action.START) {
            rotationController.rotateTo(new Angle(mc.player.getYaw(), mc.player.getPitch()),
                    RotationConfig.DEFAULT,
                    TaskPriority.HIGH_IMPORTANCE_2, this);
            switchSlotIfNeeded(slot, slot, hand);
            action = Action.WAIT;
        } else if (action == Action.WAIT && counter.isReached(70L)) {
            action = Action.USE_ITEM;
        } else if (action == Action.USE_ITEM) {
            interactWithItem(hand);
            switchSlotIfNeeded(mc.player.getInventory().selectedSlot, slot, hand);
            keyPressedAction = null;
        }
    }

    private void interact(Integer slot, Hand hand) {
        if (action == Action.START) {
            switchSlotIfNeeded(slot, slot, hand);
            action = Action.WAIT;
        } else if (action == Action.WAIT && counter.isReached(50L)) {
            action = Action.USE_ITEM;
        } else if (action == Action.USE_ITEM) {
            interactWithItem(hand);
            switchSlotIfNeeded(mc.player.getInventory().selectedSlot, slot, hand);
            keyPressedAction = null;
        }
    }

    private void switchSlotIfNeeded(Integer swapSlot, Integer slot, Hand hand) {
        if (slot != mc.player.getInventory().selectedSlot && hand != Hand.OFF_HAND) {
            mc.player.networkHandler.sendPacket(new UpdateSelectedSlotC2SPacket(swapSlot));
        }
    }

    private void interactWithItem(Hand hand) {
        mc.interactionManager.sendSequencedPacket(mc.world, sequence -> new PlayerInteractItemC2SPacket(hand, sequence));
        mc.player.swingHand(hand);
    }

    public enum Action {
        START, WAIT, USE_ITEM
    }
}
/del Вопрос что ты пофиксил гений ты поменял GLFW.GLFW_KEY_G на GLFW.GLFW_MOUSE_BUTTON_MIDDLE и говорит что пофиксил хотя это не фикс он просто поменял кнопку G на СКМ это только инвалид не сможет до чего пастеры дошли не могут поменять Кнопку G на СКМ лучше бы тему назвал ( тогда не было бы вопросов )
Expensive 4.0 | CliсkPearl Изменена клавиша G НА СКМ
 
Начинающий
Статус
Оффлайн
Регистрация
25 Янв 2024
Сообщения
361
Реакции[?]
0
Поинты[?]
1K
Фикс клик перл в сурсах экспы 4.0

ClickPearlModule:
package ru.expensive.implement.features.modules.player;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.item.EnderPearlItem;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket;
import net.minecraft.util.Hand;
import org.lwjgl.glfw.GLFW;
import ru.expensive.api.event.EventHandler;
import ru.expensive.api.feature.module.Module;
import ru.expensive.api.feature.module.ModuleCategory;
import ru.expensive.common.util.math.Counter;
import ru.expensive.common.util.player.PlayerInventoryUtil;
import ru.expensive.common.util.task.TaskPriority;
import ru.expensive.implement.events.keyboard.KeyEvent;
import ru.expensive.implement.events.player.TickEvent;
import ru.expensive.implement.features.modules.combat.killaura.rotation.Angle;
import ru.expensive.implement.features.modules.combat.killaura.rotation.RotationConfig;
import ru.expensive.implement.features.modules.combat.killaura.rotation.RotationController;

@FieldDefaults(level = AccessLevel.PRIVATE)
@SuppressWarnings("all")
public class ClickPearlModule extends Module {
    Counter counter = Counter.create();
    Runnable keyPressedAction;

    public Action action = Action.START;

    public ClickPearlModule() {
        super("ClickPearl", ModuleCategory.PLAYER);
    }

    @EventHandler
    public void onKey(KeyEvent keyEvent) {
        if (keyEvent.isMouseButtonDown(GLFW.GLFW_MOUSE_BUTTON_MIDDLE) && canPerformAction()) {
            action = Action.START;
            keyPressedAction = () -> performAction();
            counter.resetCounter();
        }
    }

    @EventHandler
    public void onTick(TickEvent tickEvent) {
        if (keyPressedAction != null) {
            keyPressedAction.run();
        }
    }

    private boolean canPerformAction() {
        return keyPressedAction == null && !mc.player.getItemCooldownManager().isCoolingDown(Items.ENDER_PEARL);
    }

    private void startAction() {
        action = Action.START;
        keyPressedAction = () -> performAction();
        counter.resetCounter();
    }

    private void performAction() {
        RotationController rotationController = RotationController.INSTANCE;

        Integer slot = PlayerInventoryUtil.INSTANCE.findHotbarSlot(Items.ENDER_PEARL);
        Hand hand = mc.player.getOffHandStack().getItem() instanceof EnderPearlItem ? Hand.OFF_HAND : Hand.MAIN_HAND;

        if (slot != null) {
            if (rotationController.getCurrentRotationPlan() != null) {
                interactWithRotation(slot, hand, rotationController);
            } else {
                interact(slot, hand);
            }
        } else {
            keyPressedAction = null;
        }
    }

    private void interactWithRotation(Integer slot, Hand hand, RotationController rotationController) {
        if (action == Action.START) {
            rotationController.rotateTo(new Angle(mc.player.getYaw(), mc.player.getPitch()),
                    RotationConfig.DEFAULT,
                    TaskPriority.HIGH_IMPORTANCE_2, this);
            switchSlotIfNeeded(slot, slot, hand);
            action = Action.WAIT;
        } else if (action == Action.WAIT && counter.isReached(70L)) {
            action = Action.USE_ITEM;
        } else if (action == Action.USE_ITEM) {
            interactWithItem(hand);
            switchSlotIfNeeded(mc.player.getInventory().selectedSlot, slot, hand);
            keyPressedAction = null;
        }
    }

    private void interact(Integer slot, Hand hand) {
        if (action == Action.START) {
            switchSlotIfNeeded(slot, slot, hand);
            action = Action.WAIT;
        } else if (action == Action.WAIT && counter.isReached(50L)) {
            action = Action.USE_ITEM;
        } else if (action == Action.USE_ITEM) {
            interactWithItem(hand);
            switchSlotIfNeeded(mc.player.getInventory().selectedSlot, slot, hand);
            keyPressedAction = null;
        }
    }

    private void switchSlotIfNeeded(Integer swapSlot, Integer slot, Hand hand) {
        if (slot != mc.player.getInventory().selectedSlot && hand != Hand.OFF_HAND) {
            mc.player.networkHandler.sendPacket(new UpdateSelectedSlotC2SPacket(swapSlot));
        }
    }

    private void interactWithItem(Hand hand) {
        mc.interactionManager.sendSequencedPacket(mc.world, sequence -> new PlayerInteractItemC2SPacket(hand, sequence));
        mc.player.swingHand(hand);
    }

    public enum Action {
        START, WAIT, USE_ITEM
    }
}
Не осилил бинд сеттинг сделать?
 
Забаненный
Статус
Оффлайн
Регистрация
8 Июн 2024
Сообщения
1
Реакции[?]
0
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Начинающий
Статус
Оффлайн
Регистрация
8 Сен 2024
Сообщения
103
Реакции[?]
0
Поинты[?]
0
Фикс клик перл в сурсах экспы 4.0

ClickPearlModule:
package ru.expensive.implement.features.modules.player;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.item.EnderPearlItem;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket;
import net.minecraft.util.Hand;
import org.lwjgl.glfw.GLFW;
import ru.expensive.api.event.EventHandler;
import ru.expensive.api.feature.module.Module;
import ru.expensive.api.feature.module.ModuleCategory;
import ru.expensive.common.util.math.Counter;
import ru.expensive.common.util.player.PlayerInventoryUtil;
import ru.expensive.common.util.task.TaskPriority;
import ru.expensive.implement.events.keyboard.KeyEvent;
import ru.expensive.implement.events.player.TickEvent;
import ru.expensive.implement.features.modules.combat.killaura.rotation.Angle;
import ru.expensive.implement.features.modules.combat.killaura.rotation.RotationConfig;
import ru.expensive.implement.features.modules.combat.killaura.rotation.RotationController;

@FieldDefaults(level = AccessLevel.PRIVATE)
@SuppressWarnings("all")
public class ClickPearlModule extends Module {
    Counter counter = Counter.create();
    Runnable keyPressedAction;

    public Action action = Action.START;

    public ClickPearlModule() {
        super("ClickPearl", ModuleCategory.PLAYER);
    }

    @EventHandler
    public void onKey(KeyEvent keyEvent) {
        if (keyEvent.isMouseButtonDown(GLFW.GLFW_MOUSE_BUTTON_MIDDLE) && canPerformAction()) {
            action = Action.START;
            keyPressedAction = () -> performAction();
            counter.resetCounter();
        }
    }

    @EventHandler
    public void onTick(TickEvent tickEvent) {
        if (keyPressedAction != null) {
            keyPressedAction.run();
        }
    }

    private boolean canPerformAction() {
        return keyPressedAction == null && !mc.player.getItemCooldownManager().isCoolingDown(Items.ENDER_PEARL);
    }

    private void startAction() {
        action = Action.START;
        keyPressedAction = () -> performAction();
        counter.resetCounter();
    }

    private void performAction() {
        RotationController rotationController = RotationController.INSTANCE;

        Integer slot = PlayerInventoryUtil.INSTANCE.findHotbarSlot(Items.ENDER_PEARL);
        Hand hand = mc.player.getOffHandStack().getItem() instanceof EnderPearlItem ? Hand.OFF_HAND : Hand.MAIN_HAND;

        if (slot != null) {
            if (rotationController.getCurrentRotationPlan() != null) {
                interactWithRotation(slot, hand, rotationController);
            } else {
                interact(slot, hand);
            }
        } else {
            keyPressedAction = null;
        }
    }

    private void interactWithRotation(Integer slot, Hand hand, RotationController rotationController) {
        if (action == Action.START) {
            rotationController.rotateTo(new Angle(mc.player.getYaw(), mc.player.getPitch()),
                    RotationConfig.DEFAULT,
                    TaskPriority.HIGH_IMPORTANCE_2, this);
            switchSlotIfNeeded(slot, slot, hand);
            action = Action.WAIT;
        } else if (action == Action.WAIT && counter.isReached(70L)) {
            action = Action.USE_ITEM;
        } else if (action == Action.USE_ITEM) {
            interactWithItem(hand);
            switchSlotIfNeeded(mc.player.getInventory().selectedSlot, slot, hand);
            keyPressedAction = null;
        }
    }

    private void interact(Integer slot, Hand hand) {
        if (action == Action.START) {
            switchSlotIfNeeded(slot, slot, hand);
            action = Action.WAIT;
        } else if (action == Action.WAIT && counter.isReached(50L)) {
            action = Action.USE_ITEM;
        } else if (action == Action.USE_ITEM) {
            interactWithItem(hand);
            switchSlotIfNeeded(mc.player.getInventory().selectedSlot, slot, hand);
            keyPressedAction = null;
        }
    }

    private void switchSlotIfNeeded(Integer swapSlot, Integer slot, Hand hand) {
        if (slot != mc.player.getInventory().selectedSlot && hand != Hand.OFF_HAND) {
            mc.player.networkHandler.sendPacket(new UpdateSelectedSlotC2SPacket(swapSlot));
        }
    }

    private void interactWithItem(Hand hand) {
        mc.interactionManager.sendSequencedPacket(mc.world, sequence -> new PlayerInteractItemC2SPacket(hand, sequence));
        mc.player.swingHand(hand);
    }

    public enum Action {
        START, WAIT, USE_ITEM
    }
}
выдаёт ошибку, что делать?
if (keyEvent.isMouseButtonDown(GLFW.GLFW_MOUSE_BUTTON_MIDDLE) && canPerformAction()) {
^
symbol: method isMouseButtonDown(int)
location: variable keyEvent of type KeyEvent
 
Сверху Снизу