Search in sources :

Example 16 with Module

use of mathax.client.systems.modules.Module in project Client by MatHax.

the class ModulesScreen method createFavoritesW.

protected boolean createFavoritesW(WWindow w) {
    boolean hasFavorites = false;
    for (Module module : Modules.get().getAll()) {
        if (module.favorite) {
            w.add(theme.module(module)).expandX();
            hasFavorites = true;
        }
    }
    return hasFavorites;
}
Also used : Module(mathax.client.systems.modules.Module)

Example 17 with Module

use of mathax.client.systems.modules.Module in project Client by MatHax.

the class AutoEat method startEating.

private void startEating() {
    prevSlot = mc.player.getInventory().selectedSlot;
    eat();
    wasAura.clear();
    if (pauseAuras.get()) {
        for (Class<? extends Module> klass : AURAS) {
            Module module = Modules.get().get(klass);
            if (module.isActive()) {
                wasAura.add(klass);
                module.toggle();
            }
        }
    }
    wasBaritone = false;
    if (pauseBaritone.get() && BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().isPathing()) {
        wasBaritone = true;
        BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("pause");
    }
}
Also used : Module(mathax.client.systems.modules.Module)

Example 18 with Module

use of mathax.client.systems.modules.Module in project Client by MatHax.

the class AutoGap method stopEating.

private void stopEating() {
    changeSlot(prevSlot);
    setPressed(false);
    eating = false;
    if (pauseAuras.get()) {
        for (Class<? extends Module> klass : AURAS) {
            Module module = Modules.get().get(klass);
            if (wasAura.contains(klass) && !module.isActive()) {
                module.toggle();
            }
        }
    }
    if (pauseBaritone.get() && wasBaritone)
        BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("resume");
}
Also used : Module(mathax.client.systems.modules.Module)

Example 19 with Module

use of mathax.client.systems.modules.Module in project Client by MatHax.

the class AutoGap method startEating.

private void startEating() {
    prevSlot = mc.player.getInventory().selectedSlot;
    eat();
    // Pause auras
    wasAura.clear();
    if (pauseAuras.get()) {
        for (Class<? extends Module> klass : AURAS) {
            Module module = Modules.get().get(klass);
            if (module.isActive()) {
                wasAura.add(klass);
                module.toggle();
            }
        }
    }
    wasBaritone = false;
    if (pauseBaritone.get() && BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().isPathing()) {
        wasBaritone = true;
        BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("pause");
    }
}
Also used : Module(mathax.client.systems.modules.Module)

Example 20 with Module

use of mathax.client.systems.modules.Module in project Client by MatHax.

the class ModuleListSetting method load.

@Override
public List<Module> load(NbtCompound tag) {
    get().clear();
    NbtList valueTag = tag.getList("modules", 8);
    for (NbtElement tagI : valueTag) {
        Module module = Modules.get().get(tagI.asString());
        if (module != null)
            get().add(module);
    }
    return get();
}
Also used : NbtList(net.minecraft.nbt.NbtList) NbtElement(net.minecraft.nbt.NbtElement) Module(mathax.client.systems.modules.Module)

Aggregations

Module (mathax.client.systems.modules.Module)29 Modules (mathax.client.systems.modules.Modules)7 ArrayList (java.util.ArrayList)5 List (java.util.List)5 SINGLE_SUCCESS (com.mojang.brigadier.Command.SINGLE_SUCCESS)4 LiteralArgumentBuilder (com.mojang.brigadier.builder.LiteralArgumentBuilder)4 WSection (mathax.client.gui.widgets.containers.WSection)4 Command (mathax.client.systems.commands.Command)4 Category (mathax.client.systems.modules.Category)4 CommandSource (net.minecraft.command.CommandSource)4 Set (java.util.Set)3 GuiTheme (mathax.client.gui.GuiTheme)3 TabScreen (mathax.client.gui.tabs.TabScreen)3 Tabs (mathax.client.gui.tabs.Tabs)3 Cell (mathax.client.gui.utils.Cell)3 WContainer (mathax.client.gui.widgets.containers.WContainer)3 WVerticalList (mathax.client.gui.widgets.containers.WVerticalList)3 WWindow (mathax.client.gui.widgets.containers.WWindow)3 WTextBox (mathax.client.gui.widgets.input.WTextBox)3 ModuleArgumentType (mathax.client.systems.commands.arguments.ModuleArgumentType)3