use of mathax.client.systems.modules.Module in project Client by MatHax.
the class ModuleListSetting method parseImpl.
@Override
protected List<Module> parseImpl(String str) {
String[] values = str.split(",");
List<Module> modules = new ArrayList<>(values.length);
try {
for (String value : values) {
Module module = Modules.get().get(value.trim());
if (module != null)
modules.add(module);
}
} catch (Exception ignored) {
}
return modules;
}
use of mathax.client.systems.modules.Module in project Client by MatHax.
the class AutoPot method stopSplashing.
private void stopSplashing() {
changeSlot(prevSlot);
setPressed(false);
if (pitched) {
if (previousPitch.get())
mc.player.setPitch(prevPitch);
else
mc.player.setPitch(stoppedPitch.get().floatValue());
pitched = false;
}
splashing = false;
if (pauseAuras.get()) {
for (Class<? extends Module> klass : AURA_LIST) {
Module module = Modules.get().get(klass);
if (wasAura.contains(klass) && !module.isActive())
module.toggle();
}
}
if (pauseBaritone.get() && wasBaritone)
BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("resume");
}
use of mathax.client.systems.modules.Module in project Client by MatHax.
the class AutoPot method startSplashing.
private void startSplashing() {
prevSlot = mc.player.getInventory().selectedSlot;
if (rotate.get()) {
switch(rotateMode.get()) {
case Server:
Rotations.rotate(mc.player.getYaw(), splashingPitch.get().floatValue());
splash();
case Client:
if (mc.player.getPitch() != splashingPitch.get().floatValue())
prevPitch = mc.player.getPitch();
pitched = true;
mc.player.setPitch(splashingPitch.get().floatValue());
splash();
}
}
splash();
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");
}
}
use of mathax.client.systems.modules.Module in project Client by MatHax.
the class ResetCommand method build.
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("settings").then(argument("module", ModuleArgumentType.module()).executes(context -> {
Module module = context.getArgument("module", Module.class);
module.settings.forEach(group -> group.forEach(Setting::reset));
module.info("Reset all settings.");
return SINGLE_SUCCESS;
})).then(literal("all").executes(context -> {
Modules.get().getAll().forEach(module -> module.settings.forEach(group -> group.forEach(Setting::reset)));
info("Reset all module settings.");
return SINGLE_SUCCESS;
}))).then(literal("gui").executes(context -> {
GuiThemes.get().clearWindowConfigs();
info("The Click GUI positioning has been reset.");
return SINGLE_SUCCESS;
}).then(literal("scale").executes(context -> {
GuiThemes.get().resetScale();
info("The GUI scale has been reset.");
return SINGLE_SUCCESS;
}))).then(literal("bind").then(argument("module", ModuleArgumentType.module()).executes(context -> {
Module module = context.getArgument("module", Module.class);
module.keybind.set(true, -1);
module.info("Reset bind.");
return SINGLE_SUCCESS;
})).then(literal("all").executes(context -> {
Modules.get().getAll().forEach(module -> module.keybind.set(true, -1));
info("Reset all binds.");
return SINGLE_SUCCESS;
}))).then(literal("hud").executes(context -> {
Systems.get(HUD.class).reset.run();
ChatUtils.info("HUD", "Reset all elements.");
return SINGLE_SUCCESS;
}));
}
use of mathax.client.systems.modules.Module in project Client by MatHax.
the class BindsCommand method build.
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.executes(context -> {
// Modules
List<Module> modules = Modules.get().getAll().stream().filter(module -> module.keybind.isSet()).collect(Collectors.toList());
info("--- Bound Modules ((highlight)%d(default)) ---", modules.size());
for (Module module : modules) {
HoverEvent hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, getTooltip(module));
MutableText text = new LiteralText(module.title).formatted(Formatting.WHITE);
text.setStyle(text.getStyle().withHoverEvent(hoverEvent));
MutableText sep = new LiteralText(" - ");
sep.setStyle(sep.getStyle().withHoverEvent(hoverEvent));
text.append(sep.formatted(Formatting.GRAY));
MutableText key = new LiteralText(module.keybind.toString());
key.setStyle(key.getStyle().withHoverEvent(hoverEvent));
text.append(key.formatted(Formatting.GRAY));
ChatUtils.sendMsg(text);
}
return SINGLE_SUCCESS;
});
}
Aggregations