Search in sources :

Example 1 with Module

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

the class ModuleListSetting method save.

@Override
public NbtCompound save(NbtCompound tag) {
    NbtList modulesTag = new NbtList();
    for (Module module : get()) modulesTag.add(NbtString.of(module.name));
    tag.put("modules", modulesTag);
    return tag;
}
Also used : NbtList(net.minecraft.nbt.NbtList) Module(mathax.client.systems.modules.Module)

Example 2 with Module

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

the class CrashReportMixin method onAddStackTrace.

@Inject(method = "addStackTrace", at = @At("TAIL"))
private void onAddStackTrace(StringBuilder sb, CallbackInfo info) {
    if (Modules.get() != null) {
        sb.append("\n\n");
        sb.append("--- MatHax ---");
        sb.append("\n");
        sb.append("Version: ").append(Version.getStylized()).append("\n");
        for (Category category : Modules.loopCategories()) {
            List<Module> modules = Modules.get().getGroup(category);
            boolean active = false;
            for (Module module : modules) {
                if (module != null && module.isActive()) {
                    active = true;
                    break;
                }
            }
            if (active) {
                sb.append("\n");
                sb.append("[").append(category).append("]:").append("\n");
                for (Module module : modules) {
                    sb.append(module.name).append("\n");
                }
            }
        }
    }
}
Also used : Category(mathax.client.systems.modules.Category) Module(mathax.client.systems.modules.Module) Inject(org.spongepowered.asm.mixin.injection.Inject)

Example 3 with Module

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

the class VisualBinds method update.

@Override
public void update(HudRenderer renderer) {
    updateBinds();
    double width = 0;
    double height = 0;
    if (Modules.get() == null) {
        String t = "KeyBinds";
        width = Math.max(width, renderer.textWidth(t));
        height += renderer.textHeight();
        box.setSize(width, height);
        return;
    }
    int i = 0;
    if (boundModules.isEmpty()) {
        String t = "You have no keybound modules";
        width = Math.max(width, renderer.textWidth(t));
        height += renderer.textHeight();
    } else {
        for (Module boundModule : boundModules) {
            String length = boundModule.title + separator.get().separator + Utils.getKeyName(boundModule.keybind.getValue());
            width = Math.max(width, renderer.textWidth(length));
            height += renderer.textHeight();
            if (i > 0)
                height += 2;
            i++;
        }
    }
    box.setSize(width, height);
}
Also used : Module(mathax.client.systems.modules.Module)

Example 4 with Module

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

the class VisualBinds method render.

@Override
public void render(HudRenderer renderer) {
    updateBinds();
    double x = box.getX();
    double y = box.getY();
    if (Modules.get() == null) {
        renderer.text("KeyBinds", x, y, hud.primaryColor.get());
        return;
    }
    int i = 0;
    if (boundModules.isEmpty()) {
        String t = "You have no keybound modules";
        renderer.text(t, x + box.alignX(renderer.textWidth(t)), y, hud.primaryColor.get());
    } else {
        for (Module boundModule : boundModules) {
            String separatorString = separator.get().separator;
            String length = boundModule.title + separatorString + Utils.getKeyName(boundModule.keybind.getValue());
            renderer.text(boundModule.title, x + box.alignX(renderer.textWidth(length)), y, hud.primaryColor.get());
            renderer.text(separatorString, x + renderer.textWidth(boundModule.title) + box.alignX(renderer.textWidth(length)), y, hud.secondaryColor.get());
            renderer.text(Utils.getKeyName(boundModule.keybind.getValue()), x + renderer.textWidth(boundModule.title) + renderer.textWidth(separatorString) + box.alignX(renderer.textWidth(length)), y, hud.primaryColor.get());
            y += renderer.textHeight();
            if (i > 0)
                y += 2;
            i++;
        }
    }
}
Also used : Module(mathax.client.systems.modules.Module)

Example 5 with Module

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

the class AutoPot method startDrinking.

private void startDrinking() {
    prevSlot = mc.player.getInventory().selectedSlot;
    drink();
    wasAura.clear();
    if (pauseAuras.get()) {
        for (Class<? extends Module> klass : AURA_LIST) {
            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)

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