[CHORE] Try to improve invalid config error messages

This commit is contained in:
2024-01-02 02:06:56 +02:00
parent 855ddd0649
commit ef4ad35923
3 changed files with 4 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
version_major=0 version_major=0
version_minor=0 version_minor=0
version_patch=56 version_patch=57
shade_group=com.hypherionmc.sdlink.shaded. shade_group=com.hypherionmc.sdlink.shaded.

View File

@@ -25,6 +25,7 @@ public class SDLinkConfig extends ModuleConfig {
// WILL TRY TO WRITE THESE TO THE CONFIG // WILL TRY TO WRITE THESE TO THE CONFIG
public transient static SDLinkConfig INSTANCE; public transient static SDLinkConfig INSTANCE;
public transient static int configVer = 13; public transient static int configVer = 13;
public transient static boolean hasConfigLoaded = false;
@Path("general") @Path("general")
@SpecComment("General Mod Config") @SpecComment("General Mod Config")
@@ -104,6 +105,7 @@ public class SDLinkConfig extends ModuleConfig {
@Override @Override
public void configReloaded() { public void configReloaded() {
INSTANCE = loadConfig(this); INSTANCE = loadConfig(this);
hasConfigLoaded = true;
} }
/** /**

View File

@@ -95,7 +95,7 @@ public class BotController {
* Start the bot and handle all the startup work * Start the bot and handle all the startup work
*/ */
public void initializeBot() { public void initializeBot() {
if (SDLinkConfig.INSTANCE == null) { if (SDLinkConfig.INSTANCE == null || !SDLinkConfig.hasConfigLoaded) {
logger.error("Failed to load config. Check your log for errors"); logger.error("Failed to load config. Check your log for errors");
return; return;
} }