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;
}
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");
}
}
}
}
}
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);
}
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++;
}
}
}
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");
}
}
Aggregations