Fix some config setup not running if the UI isn't opened

This commit is contained in:
James Seibel
2023-06-17 21:53:22 -05:00
parent 5915bb1f70
commit 1de329ed9b
3 changed files with 5 additions and 17 deletions
@@ -48,7 +48,9 @@ public class LodCommonMain {
// }
}
public static void initConfig() {
public static void initConfig()
{
ConfigBase.INSTANCE = new ConfigBase(ModInfo.ID, ModInfo.NAME, Config.class,1);
}
Config.completeDelayedSetup();
}
}
@@ -28,8 +28,6 @@ public class GetConfigScreen
// This shouldn't be here, but I need a way to test it after Minecraft inits its assets
//System.out.println(ConfigBase.INSTANCE.generateLang(false, true));
runGuiOnlyConfigSetup();
return switch (useScreen)
{
case Classic -> ClassicConfigGUI.getScreen(ConfigBase.INSTANCE, parent, "client");
@@ -39,16 +37,4 @@ public class GetConfigScreen
default -> null;
};
}
/**
* Updates any config values that are UI only
* and adds any listeners that depend on multiple config values.
*/
private static void runGuiOnlyConfigSetup()
{
ThreadPresetConfigEventHandler.INSTANCE.setUiOnlyConfigValues();
RenderQualityPresetConfigEventHandler.INSTANCE.setUiOnlyConfigValues();
QuickRenderToggleConfigEventHandler.INSTANCE.setUiOnlyConfigValues();
}
}