fix config loading, add arraylist module info
- fullbright no longer crashes during config load (mc.options is null while the game is still starting, which aborted loading every module registered after fullbright - including killaura's keybind) - one broken module no longer aborts loading the rest - fix "is a directory" IOException on every startup (commandmanager had no file name, so it resolved to the config folder itself) - arraylist: alignment/sort options, module info shown on the opposite side of the row, hides hud/disabled modules behind settings - killaura: show target name as module info
This commit is contained in:
@@ -17,6 +17,7 @@ import cc.fros.features.modules.client.NotificationsModule;
|
||||
import cc.fros.features.modules.combat.KillAuraModule;
|
||||
import cc.fros.features.modules.combat.CriticalsModule;
|
||||
import cc.fros.features.modules.combat.KeyPearlModule;
|
||||
import cc.fros.features.modules.hud.ArrayListHudModule;
|
||||
import cc.fros.features.modules.hud.CoordinatesHudModule;
|
||||
import cc.fros.features.modules.hud.FpsHudModule;
|
||||
import cc.fros.features.modules.hud.PingHudModule;
|
||||
@@ -48,6 +49,7 @@ public class ModuleManager implements Jsonable, Util {
|
||||
private final List<Module> modules = new ArrayList<>();
|
||||
|
||||
public void init() {
|
||||
register(new ArrayListHudModule());
|
||||
register(new WatermarkHudModule());
|
||||
register(new CoordinatesHudModule());
|
||||
register(new FpsHudModule());
|
||||
@@ -165,8 +167,14 @@ public class ModuleManager implements Jsonable, Util {
|
||||
|
||||
@Override
|
||||
public void fromJson(JsonElement element) {
|
||||
if (element == null || !element.isJsonObject()) return;
|
||||
for (Module module : getModules()) {
|
||||
module.fromJson(element.getAsJsonObject().get(module.getName()));
|
||||
// one broken module must never abort loading the rest
|
||||
try {
|
||||
module.fromJson(element.getAsJsonObject().get(module.getName()));
|
||||
} catch (Throwable throwable) {
|
||||
LOGGER.error("Failed to load module {}", module.getName(), throwable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user