LoadCommand remove unloading test for reload later

This commit is contained in:
noil 2023-05-17 02:05:59 -04:00
parent e132ed7365
commit 811a56f3fa
2 changed files with 7 additions and 8 deletions

View File

@ -64,7 +64,6 @@ public final class LoadCommand extends Command {
} }
if (entry.getKey().equalsIgnoreCase("Search")) { if (entry.getKey().equalsIgnoreCase("Search")) {
this.loadConfigForClass(SearchConfig.class, entry.getValue().getAsJsonObject()); this.loadConfigForClass(SearchConfig.class, entry.getValue().getAsJsonObject());
} }
Seppuku.INSTANCE.getModuleManager().getModuleList().forEach(module -> { Seppuku.INSTANCE.getModuleManager().getModuleList().forEach(module -> {
if (entry.getKey().equalsIgnoreCase("Module" + module.getDisplayName())) { if (entry.getKey().equalsIgnoreCase("Module" + module.getDisplayName())) {
@ -78,8 +77,8 @@ public final class LoadCommand extends Command {
}); });
}); });
Seppuku.INSTANCE.unloadSimple(); // Seppuku.INSTANCE.getConfigManager().saveAll();
Seppuku.INSTANCE.init(); // Seppuku.INSTANCE.reload();
Seppuku.INSTANCE.logChat("\247c" + "Loaded config from server"); Seppuku.INSTANCE.logChat("\247c" + "Loaded config from server");
} }
@ -94,8 +93,8 @@ public final class LoadCommand extends Command {
private void loadModuleConfigForClass(Class configClass, JsonObject jsonObject, String displayName) { private void loadModuleConfigForClass(Class configClass, JsonObject jsonObject, String displayName) {
Seppuku.INSTANCE.getConfigManager().getConfigurableList().stream().filter(configurable -> configurable.getClass().equals(ModuleConfig.class)).forEach(configurable -> { Seppuku.INSTANCE.getConfigManager().getConfigurableList().stream().filter(configurable -> configurable.getClass().equals(ModuleConfig.class)).forEach(configurable -> {
final ModuleConfig moduleConfig = (ModuleConfig) configurable; final ModuleConfig moduleConfig = (ModuleConfig) configurable;
if (moduleConfig.getModule().getDisplayName().equals(displayName)) { if (moduleConfig.getModule().getDisplayName().equalsIgnoreCase(displayName)) {
configurable.onLoad(jsonObject); moduleConfig.onLoad(jsonObject);
} }
}); });
} }
@ -103,8 +102,8 @@ public final class LoadCommand extends Command {
private void loadHudConfigForClass(Class configClass, JsonObject jsonObject, String name) { private void loadHudConfigForClass(Class configClass, JsonObject jsonObject, String name) {
Seppuku.INSTANCE.getConfigManager().getConfigurableList().stream().filter(configurable -> configurable.getClass().equals(HudConfig.class)).forEach(configurable -> { Seppuku.INSTANCE.getConfigManager().getConfigurableList().stream().filter(configurable -> configurable.getClass().equals(HudConfig.class)).forEach(configurable -> {
final HudConfig hudConfig = (HudConfig) configurable; final HudConfig hudConfig = (HudConfig) configurable;
if (hudConfig.getHudComponent().getName().equals(name)) { if (hudConfig.getHudComponent().getName().equalsIgnoreCase(name)) {
configurable.onLoad(jsonObject); hudConfig.onLoad(jsonObject);
} }
}); });
} }

View File

@ -86,7 +86,7 @@ public final class ConfigManager {
this.configurableList.add(new ModuleConfig(this.moduleConfigDir, module)); this.configurableList.add(new ModuleConfig(this.moduleConfigDir, module));
}); });
Seppuku.INSTANCE.getHudManager().getComponentList().stream().forEach(hudComponent -> { Seppuku.INSTANCE.getHudManager().getComponentList().forEach(hudComponent -> {
this.configurableList.add(new HudConfig(this.hudComponentConfigDir, hudComponent)); this.configurableList.add(new HudConfig(this.hudComponentConfigDir, hudComponent));
}); });