Исходник FTHelper Funtime expensive 2.0

Начинающий
Статус
Оффлайн
Регистрация
22 Сен 2023
Сообщения
43
Реакции[?]
0
Поинты[?]
0
Я считаю что довольно неплохой fthelper
1719431905359.png
1719431915045.png

Код:
package Anova.modules.impl.util;

import Anova.modules.settings.imp.BooleanOption;
import Anova.modules.settings.imp.MultiBoxSetting;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.network.play.client.CPlayerTryUseItemPacket;
import net.minecraft.util.Hand;
import Anova.events.Event;
import Anova.events.impl.game.EventKey;
import Anova.modules.Function;
import Anova.modules.FunctionAnnotation;
import Anova.modules.Type;
import Anova.modules.settings.imp.BindSetting;
import Anova.util.misc.TimerUtil;

@FunctionAnnotation(name = "FTHelper", type = Type.Util)
public class Funtimehelper extends Function {
    private final MultiBoxSetting setting = new MultiBoxSetting("Бинды",
            new BooleanOption("Дезорентация", false),
            new BooleanOption("Трапка", false),
            new BooleanOption("Явная пыль", false),
            new BooleanOption("Огненный смерч",false),
            new BooleanOption("Пласт",false),
            new BooleanOption("Божья аура",false),
            new BooleanOption("Зелье отрыжки", false),
            new BooleanOption("Зелье киллера", false),
            new BooleanOption("Зелье Мочи флеша", false),
            new BooleanOption("Зелье Медика", false),
            new BooleanOption("Зелье Агента", false),
            new BooleanOption("Зелье Победителя", false),
            new BooleanOption("Зелье Серной кислоты", false),
            new BooleanOption("Зелье Вспышки", false),
            new BooleanOption("Активация Арбалета",false)
    );

    private final BindSetting disorient = new BindSetting("Дезориентация", 0).setVisible(() -> setting.get(0));
    private final BindSetting trap = new BindSetting("Трапка", 0).setVisible(() -> setting.get(1));
    private final BindSetting obviousdust = new BindSetting("Явная пыль", 0).setVisible(() -> setting.get(2));
    private final BindSetting smerchog = new BindSetting("Огненный смерч",0).setVisible(() -> setting.get(3));
    private final BindSetting plast = new BindSetting("Пласт",0).setVisible(() -> setting.get(4));
    private final BindSetting aura = new BindSetting("Божья аура",0).setVisible(() -> setting.get(5));
    private final BindSetting otrishka = new BindSetting("Зелье отрыжки", 0).setVisible(() -> setting.get(6));
    private final BindSetting killerka = new BindSetting("Зелье киллера", 0).setVisible(() -> setting.get(7));
    private final BindSetting flesh = new BindSetting("Зелье Мочи флеша", 0).setVisible(() -> setting.get(8));
    private final BindSetting medik = new BindSetting("Зелье Медика", 0).setVisible(() -> setting.get(9));
    private final BindSetting agent007 = new BindSetting("Зелье Агента", 0).setVisible(() -> setting.get(10));
    private final BindSetting zelkapobediteli = new BindSetting("Зелье Победителя", 0).setVisible(() -> setting.get(11));
    private final BindSetting zelkapidora = new BindSetting("Зелье Серной кислоты", 0).setVisible(() -> setting.get(12));
    private final BindSetting zelkabecpoleznosti = new BindSetting("Зелье Вспышки", 0).setVisible(() -> setting.get(13));
    private final BindSetting arbalet = new BindSetting("Использовать арбалетом",0).setVisible(() -> setting.get(14));

    private final TimerUtil disorientTimer = new TimerUtil();
    private final TimerUtil trapTimer = new TimerUtil();
    private final TimerUtil obviousdusttimer = new TimerUtil();

    public Funtimehelper() {
        addSettings(setting, disorient, trap, obviousdust,smerchog,plast,aura, otrishka, killerka, flesh, medik, agent007, zelkapobediteli, zelkapidora, zelkabecpoleznosti,arbalet);
    }

    @Override
    public void onEvent(Event event) {
        if (event instanceof EventKey) {
            EventKey eventKey = (EventKey) event;
            if (eventKey.key == this.disorient.getKey() && this.disorientTimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                use(getDisorientAtHotBar(), getDisorientAtInventory());
                this.disorientTimer.reset();
            }
            if (eventKey.key == this.trap.getKey() && this.trapTimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                use(getTrapAtHotBar(), getTrapAtInventory());
                this.trapTimer.reset();
            }
            if (eventKey.key == this.obviousdust.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getObviousDustAtHotBar(), getObviousDustAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.otrishka.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getOtrishkaAtHotbar(), getOtrishkaAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.killerka.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getKillerkaAtHotbar(), getKillerkaAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.flesh.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getFleshAtHotbar(), getFleshAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.medik.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getMedikAtHotbar(), getMedikAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.agent007.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getAgent007AtHotbar(), getAgent007AtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.zelkapobediteli.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getZelkaPobediteliAtHotbar(), getZelkaPobediteliAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.zelkapidora.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getZelkaPidoraAtHotbar(), getZelkaPidoraAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.zelkabecpoleznosti.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getZelkaBecPoleznostiAtHotbar(), getZelkaBecPoleznostiAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.arbalet.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getarbaletAtHotBar(), getArbaletInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.plast.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getplastAtHotbar(), getplastAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.smerchog.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getsmerchogAtHotbar(), getsmerchogAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.aura.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                use(getAuraInHotbar(), getAuraInInventory());
                this.obviousdusttimer.reset();
            }
        }
    }

    private void use(int hotbarSlot, int inventorySlot) {
        if (hotbarSlot != -1) {
            int currentSlot = mc.player.inventory.currentItem;
            mc.player.inventory.currentItem = hotbarSlot;
            mc.player.connection.sendPacket(new CHeldItemChangePacket(hotbarSlot));
            mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(Hand.MAIN_HAND));
            mc.player.inventory.currentItem = currentSlot;
            mc.player.connection.sendPacket(new CHeldItemChangePacket(currentSlot));
        } else if (inventorySlot != -1) {
            int currentSlot = mc.player.inventory.currentItem;
            swapItems(inventorySlot, currentSlot);
            mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(Hand.MAIN_HAND));
            swapItems(inventorySlot, currentSlot);
        }
    }
    private void swapItems(int slot1, int slot2) {
        mc.playerController.windowClick(0, slot1, 0, ClickType.PICKUP, mc.player);
        mc.playerController.windowClick(0, slot2 + 36, 0, ClickType.PICKUP, mc.player);
        mc.playerController.windowClick(0, slot1, 0, ClickType.PICKUP, mc.player);
        if (!mc.player.inventory.getStackInSlot(slot1).isEmpty() && mc.player.inventory.getStackInSlot(slot2 + 36).isEmpty()) {
            mc.playerController.windowClick(0, slot2 + 36, 0, ClickType.PICKUP, mc.player);
        }
    }


    private void usePotion(int hotbarSlot, int inventorySlot) {
        if (hotbarSlot != -1) {
            int currentSlot = mc.player.inventory.currentItem;
            mc.player.inventory.currentItem = hotbarSlot;
            mc.player.connection.sendPacket(new CHeldItemChangePacket(hotbarSlot));
            mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
            mc.player.inventory.currentItem = currentSlot;
            mc.player.connection.sendPacket(new CHeldItemChangePacket(currentSlot));
        } else if (inventorySlot != -1) {
            swapItems(inventorySlot, mc.player.inventory.currentItem);
            mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
            swapItems(inventorySlot, mc.player.inventory.currentItem);
        }
        this.obviousdusttimer.reset();
    }


    private int getDisorientAtHotBar() {
        return findItemInHotbar(Items.ENDER_EYE);
    }
    private int getAuraInHotbar(){
        return findItemInHotbar(Items.PHANTOM_MEMBRANE);
    }
    private int getAuraInInventory(){
        return findItemInInventory(Items.PHANTOM_MEMBRANE);
    }

    private int getTrapAtHotBar() {
        return findItemInHotbar(Items.NETHERITE_SCRAP);
    }

    private int getObviousDustAtHotBar() {
        return findItemInHotbar(Items.SUGAR);
    }
    private int getarbaletAtHotBar(){
        return findItemInHotbar(Items.CROSSBOW);
    }
    private int getsmerchogAtHotbar(){
        return findItemInHotbar(Items.FIRE_CHARGE);
    }
    private int getsmerchogAtInventory(){
        return findItemInInventory(Items.FIRE_CHARGE);
    }

    private int getplastAtHotbar(){
        return findItemInHotbar(Items.DRIED_KELP);
    }
    private int getplastAtInventory(){
        return findItemInInventory(Items.DRIED_KELP);
    }
    private int getDisorientAtInventory() {
        return findItemInInventory(Items.ENDER_EYE);
    }

    private int getTrapAtInventory() {
        return findItemInInventory(Items.NETHERITE_SCRAP);
    }
    private int getArbaletInventory(){
        return findItemInInventory(Items.CROSSBOW);
    }

    private int getObviousDustAtInventory() {
        return findItemInInventory(Items.SUGAR);
    }
    private int getOtrishkaAtHotbar() {
        return findPotionInHotbar("Зелье Отрыжки");
    }

    private int getKillerkaAtHotbar() {
        return findPotionInHotbar("Зелье киллера");
    }

    private int getFleshAtHotbar() {
        return findPotionInHotbar("Моча флеша");
    }

    private int getMedikAtHotbar() {
        return findPotionInHotbar("Зелье Медика");
    }

    private int getAgent007AtHotbar() {
        return findPotionInHotbar("Зелье Агента");
    }

    private int getZelkaPobediteliAtHotbar() {
        return findPotionInHotbar("Зелье Победителя");
    }

    private int getZelkaPidoraAtHotbar() {
        return findPotionInHotbar("Серная кислота");
    }

    private int getZelkaBecPoleznostiAtHotbar() {
        return findPotionInHotbar("Зелье Вспышки");
    }

    private int getOtrishkaAtInventory() {
        return findPotionInInventory("Зелье отрыжки");
    }

    private int getKillerkaAtInventory() {
        return findPotionInInventory("Зелье киллера");
    }

    private int getFleshAtInventory() {
        return findPotionInInventory("Моча флеша");
    }

    private int getMedikAtInventory() {
        return findPotionInInventory("Зелье Медика");
    }

    private int getAgent007AtInventory() {
        return findPotionInInventory("Зелье Агента");
    }

    private int getZelkaPobediteliAtInventory() {
        return findPotionInInventory("Зелье Победителя");
    }

    private int getZelkaPidoraAtInventory() {
        return findPotionInInventory("Серная кислота");
    }

    private int getZelkaBecPoleznostiAtInventory() {
        return findPotionInInventory("Зелье Вспышки");
    }

    private int findItemInHotbar(Item item) {
        for (int i = 0; i < 9; i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack.getItem() == item) {
                return i;
            }
        }
        return -1;
    }

    private int findItemInInventory(Item item) {
        for (int i = 9; i < 36; i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack.getItem() == item) {
                return i;
            }
        }
        return -1;
    }

    private int findPotionInHotbar(String potionName) {
        for (int i = 0; i < 9; i++) {
            ItemStack itemStack = mc.player.inventory.getStackInSlot(i);
            if (!itemStack.isEmpty()) {
                String displayName = itemStack.getDisplayName().getString().toLowerCase();
                String itemName = itemStack.getItem().getTranslationKey().toLowerCase();

                if (displayName.contains(potionName.toLowerCase()) || itemName.contains(potionName.toLowerCase())) {
                    return i;
                }
            }
        }
        return -1;
    }


    private int findPotionInInventory(String potionName) {
        for (int i = 9; i < 36; ++i) {
            ItemStack itemStack = mc.player.inventory.getStackInSlot(i);
            if (!itemStack.isEmpty() && itemStack.getItem() == Items.SPLASH_POTION) {
                String displayName = itemStack.getDisplayName().getString().toLowerCase();
                if (displayName.contains(potionName.toLowerCase())) {
                    return i;
                }
            }
        }
        return -1;
    }
}
 
Начинающий
Статус
Оффлайн
Регистрация
20 Фев 2024
Сообщения
49
Реакции[?]
0
Поинты[?]
0
Я считаю что довольно неплохой fthelper
Посмотреть вложение 280100
Посмотреть вложение 280101

Код:
package Anova.modules.impl.util;

import Anova.modules.settings.imp.BooleanOption;
import Anova.modules.settings.imp.MultiBoxSetting;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.network.play.client.CPlayerTryUseItemPacket;
import net.minecraft.util.Hand;
import Anova.events.Event;
import Anova.events.impl.game.EventKey;
import Anova.modules.Function;
import Anova.modules.FunctionAnnotation;
import Anova.modules.Type;
import Anova.modules.settings.imp.BindSetting;
import Anova.util.misc.TimerUtil;

@FunctionAnnotation(name = "FTHelper", type = Type.Util)
public class Funtimehelper extends Function {
    private final MultiBoxSetting setting = new MultiBoxSetting("Бинды",
            new BooleanOption("Дезорентация", false),
            new BooleanOption("Трапка", false),
            new BooleanOption("Явная пыль", false),
            new BooleanOption("Огненный смерч",false),
            new BooleanOption("Пласт",false),
            new BooleanOption("Божья аура",false),
            new BooleanOption("Зелье отрыжки", false),
            new BooleanOption("Зелье киллера", false),
            new BooleanOption("Зелье Мочи флеша", false),
            new BooleanOption("Зелье Медика", false),
            new BooleanOption("Зелье Агента", false),
            new BooleanOption("Зелье Победителя", false),
            new BooleanOption("Зелье Серной кислоты", false),
            new BooleanOption("Зелье Вспышки", false),
            new BooleanOption("Активация Арбалета",false)
    );

    private final BindSetting disorient = new BindSetting("Дезориентация", 0).setVisible(() -> setting.get(0));
    private final BindSetting trap = new BindSetting("Трапка", 0).setVisible(() -> setting.get(1));
    private final BindSetting obviousdust = new BindSetting("Явная пыль", 0).setVisible(() -> setting.get(2));
    private final BindSetting smerchog = new BindSetting("Огненный смерч",0).setVisible(() -> setting.get(3));
    private final BindSetting plast = new BindSetting("Пласт",0).setVisible(() -> setting.get(4));
    private final BindSetting aura = new BindSetting("Божья аура",0).setVisible(() -> setting.get(5));
    private final BindSetting otrishka = new BindSetting("Зелье отрыжки", 0).setVisible(() -> setting.get(6));
    private final BindSetting killerka = new BindSetting("Зелье киллера", 0).setVisible(() -> setting.get(7));
    private final BindSetting flesh = new BindSetting("Зелье Мочи флеша", 0).setVisible(() -> setting.get(8));
    private final BindSetting medik = new BindSetting("Зелье Медика", 0).setVisible(() -> setting.get(9));
    private final BindSetting agent007 = new BindSetting("Зелье Агента", 0).setVisible(() -> setting.get(10));
    private final BindSetting zelkapobediteli = new BindSetting("Зелье Победителя", 0).setVisible(() -> setting.get(11));
    private final BindSetting zelkapidora = new BindSetting("Зелье Серной кислоты", 0).setVisible(() -> setting.get(12));
    private final BindSetting zelkabecpoleznosti = new BindSetting("Зелье Вспышки", 0).setVisible(() -> setting.get(13));
    private final BindSetting arbalet = new BindSetting("Использовать арбалетом",0).setVisible(() -> setting.get(14));

    private final TimerUtil disorientTimer = new TimerUtil();
    private final TimerUtil trapTimer = new TimerUtil();
    private final TimerUtil obviousdusttimer = new TimerUtil();

    public Funtimehelper() {
        addSettings(setting, disorient, trap, obviousdust,smerchog,plast,aura, otrishka, killerka, flesh, medik, agent007, zelkapobediteli, zelkapidora, zelkabecpoleznosti,arbalet);
    }

    @Override
    public void onEvent(Event event) {
        if (event instanceof EventKey) {
            EventKey eventKey = (EventKey) event;
            if (eventKey.key == this.disorient.getKey() && this.disorientTimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                use(getDisorientAtHotBar(), getDisorientAtInventory());
                this.disorientTimer.reset();
            }
            if (eventKey.key == this.trap.getKey() && this.trapTimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                use(getTrapAtHotBar(), getTrapAtInventory());
                this.trapTimer.reset();
            }
            if (eventKey.key == this.obviousdust.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getObviousDustAtHotBar(), getObviousDustAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.otrishka.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getOtrishkaAtHotbar(), getOtrishkaAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.killerka.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getKillerkaAtHotbar(), getKillerkaAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.flesh.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getFleshAtHotbar(), getFleshAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.medik.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getMedikAtHotbar(), getMedikAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.agent007.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getAgent007AtHotbar(), getAgent007AtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.zelkapobediteli.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getZelkaPobediteliAtHotbar(), getZelkaPobediteliAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.zelkapidora.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getZelkaPidoraAtHotbar(), getZelkaPidoraAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.zelkabecpoleznosti.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getZelkaBecPoleznostiAtHotbar(), getZelkaBecPoleznostiAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.arbalet.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getarbaletAtHotBar(), getArbaletInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.plast.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getplastAtHotbar(), getplastAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.smerchog.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                usePotion(getsmerchogAtHotbar(), getsmerchogAtInventory());
                this.obviousdusttimer.reset();
            }
            if (eventKey.key == this.aura.getKey() && this.obviousdusttimer.hasTimeElapsed(3000L) && mc.currentScreen == null) {
                use(getAuraInHotbar(), getAuraInInventory());
                this.obviousdusttimer.reset();
            }
        }
    }

    private void use(int hotbarSlot, int inventorySlot) {
        if (hotbarSlot != -1) {
            int currentSlot = mc.player.inventory.currentItem;
            mc.player.inventory.currentItem = hotbarSlot;
            mc.player.connection.sendPacket(new CHeldItemChangePacket(hotbarSlot));
            mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(Hand.MAIN_HAND));
            mc.player.inventory.currentItem = currentSlot;
            mc.player.connection.sendPacket(new CHeldItemChangePacket(currentSlot));
        } else if (inventorySlot != -1) {
            int currentSlot = mc.player.inventory.currentItem;
            swapItems(inventorySlot, currentSlot);
            mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(Hand.MAIN_HAND));
            swapItems(inventorySlot, currentSlot);
        }
    }
    private void swapItems(int slot1, int slot2) {
        mc.playerController.windowClick(0, slot1, 0, ClickType.PICKUP, mc.player);
        mc.playerController.windowClick(0, slot2 + 36, 0, ClickType.PICKUP, mc.player);
        mc.playerController.windowClick(0, slot1, 0, ClickType.PICKUP, mc.player);
        if (!mc.player.inventory.getStackInSlot(slot1).isEmpty() && mc.player.inventory.getStackInSlot(slot2 + 36).isEmpty()) {
            mc.playerController.windowClick(0, slot2 + 36, 0, ClickType.PICKUP, mc.player);
        }
    }


    private void usePotion(int hotbarSlot, int inventorySlot) {
        if (hotbarSlot != -1) {
            int currentSlot = mc.player.inventory.currentItem;
            mc.player.inventory.currentItem = hotbarSlot;
            mc.player.connection.sendPacket(new CHeldItemChangePacket(hotbarSlot));
            mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
            mc.player.inventory.currentItem = currentSlot;
            mc.player.connection.sendPacket(new CHeldItemChangePacket(currentSlot));
        } else if (inventorySlot != -1) {
            swapItems(inventorySlot, mc.player.inventory.currentItem);
            mc.playerController.processRightClick(mc.player, mc.world, Hand.MAIN_HAND);
            swapItems(inventorySlot, mc.player.inventory.currentItem);
        }
        this.obviousdusttimer.reset();
    }


    private int getDisorientAtHotBar() {
        return findItemInHotbar(Items.ENDER_EYE);
    }
    private int getAuraInHotbar(){
        return findItemInHotbar(Items.PHANTOM_MEMBRANE);
    }
    private int getAuraInInventory(){
        return findItemInInventory(Items.PHANTOM_MEMBRANE);
    }

    private int getTrapAtHotBar() {
        return findItemInHotbar(Items.NETHERITE_SCRAP);
    }

    private int getObviousDustAtHotBar() {
        return findItemInHotbar(Items.SUGAR);
    }
    private int getarbaletAtHotBar(){
        return findItemInHotbar(Items.CROSSBOW);
    }
    private int getsmerchogAtHotbar(){
        return findItemInHotbar(Items.FIRE_CHARGE);
    }
    private int getsmerchogAtInventory(){
        return findItemInInventory(Items.FIRE_CHARGE);
    }

    private int getplastAtHotbar(){
        return findItemInHotbar(Items.DRIED_KELP);
    }
    private int getplastAtInventory(){
        return findItemInInventory(Items.DRIED_KELP);
    }
    private int getDisorientAtInventory() {
        return findItemInInventory(Items.ENDER_EYE);
    }

    private int getTrapAtInventory() {
        return findItemInInventory(Items.NETHERITE_SCRAP);
    }
    private int getArbaletInventory(){
        return findItemInInventory(Items.CROSSBOW);
    }

    private int getObviousDustAtInventory() {
        return findItemInInventory(Items.SUGAR);
    }
    private int getOtrishkaAtHotbar() {
        return findPotionInHotbar("Зелье Отрыжки");
    }

    private int getKillerkaAtHotbar() {
        return findPotionInHotbar("Зелье киллера");
    }

    private int getFleshAtHotbar() {
        return findPotionInHotbar("Моча флеша");
    }

    private int getMedikAtHotbar() {
        return findPotionInHotbar("Зелье Медика");
    }

    private int getAgent007AtHotbar() {
        return findPotionInHotbar("Зелье Агента");
    }

    private int getZelkaPobediteliAtHotbar() {
        return findPotionInHotbar("Зелье Победителя");
    }

    private int getZelkaPidoraAtHotbar() {
        return findPotionInHotbar("Серная кислота");
    }

    private int getZelkaBecPoleznostiAtHotbar() {
        return findPotionInHotbar("Зелье Вспышки");
    }

    private int getOtrishkaAtInventory() {
        return findPotionInInventory("Зелье отрыжки");
    }

    private int getKillerkaAtInventory() {
        return findPotionInInventory("Зелье киллера");
    }

    private int getFleshAtInventory() {
        return findPotionInInventory("Моча флеша");
    }

    private int getMedikAtInventory() {
        return findPotionInInventory("Зелье Медика");
    }

    private int getAgent007AtInventory() {
        return findPotionInInventory("Зелье Агента");
    }

    private int getZelkaPobediteliAtInventory() {
        return findPotionInInventory("Зелье Победителя");
    }

    private int getZelkaPidoraAtInventory() {
        return findPotionInInventory("Серная кислота");
    }

    private int getZelkaBecPoleznostiAtInventory() {
        return findPotionInInventory("Зелье Вспышки");
    }

    private int findItemInHotbar(Item item) {
        for (int i = 0; i < 9; i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack.getItem() == item) {
                return i;
            }
        }
        return -1;
    }

    private int findItemInInventory(Item item) {
        for (int i = 9; i < 36; i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack.getItem() == item) {
                return i;
            }
        }
        return -1;
    }

    private int findPotionInHotbar(String potionName) {
        for (int i = 0; i < 9; i++) {
            ItemStack itemStack = mc.player.inventory.getStackInSlot(i);
            if (!itemStack.isEmpty()) {
                String displayName = itemStack.getDisplayName().getString().toLowerCase();
                String itemName = itemStack.getItem().getTranslationKey().toLowerCase();

                if (displayName.contains(potionName.toLowerCase()) || itemName.contains(potionName.toLowerCase())) {
                    return i;
                }
            }
        }
        return -1;
    }


    private int findPotionInInventory(String potionName) {
        for (int i = 9; i < 36; ++i) {
            ItemStack itemStack = mc.player.inventory.getStackInSlot(i);
            if (!itemStack.isEmpty() && itemStack.getItem() == Items.SPLASH_POTION) {
                String displayName = itemStack.getDisplayName().getString().toLowerCase();
                if (displayName.contains(potionName.toLowerCase())) {
                    return i;
                }
            }
        }
        return -1;
    }
}
Годно
 
Начинающий
Статус
Оффлайн
Регистрация
3 Окт 2023
Сообщения
10
Реакции[?]
0
Поинты[?]
0
Приветсвую,только зашел и не могу разобраться,куда вставлять этот код?у меня expensive 2.0
 
Начинающий
Статус
Оффлайн
Регистрация
22 Сен 2023
Сообщения
43
Реакции[?]
0
Поинты[?]
0
Сверху Снизу