added config toggle for console command log

This commit is contained in:
Jonas_Jones 2023-09-07 19:39:22 +02:00
parent d7f982af05
commit 3ea416faea
2 changed files with 18 additions and 8 deletions

View file

@ -7,6 +7,7 @@ public class ModConfigs {
public static SimpleConfig MODCONFIG;
public static boolean IS_ENABLED;
public static boolean REUQIRE_OP;
public static boolean LOG_CMD_OUTPUT;
private static ModConfigProvider modconfigs;
public static void registerConfigs() {
@ -22,11 +23,13 @@ public class ModConfigs {
modconfigs.addSingleLineComment("This is the config file for BetterConsoleMC");
modconfigs.addKeyValuePair(new Pair<>("bettercmd.enable", true), "whether or not to the mod is enabled or not.");
modconfigs.addKeyValuePair(new Pair<>("bettercmd.requireOp", true), "whether or not operator level is required in order to run commands.");
modconfigs.addKeyValuePair(new Pair<>("bettercmd.logCmdOutput", false), "whether or not to log the output of commands to the console.");
}
private static void assignConfigs() {
IS_ENABLED = MODCONFIG.getOrDefault("cmd.enable", true);
REUQIRE_OP = MODCONFIG.getOrDefault("cmd.requireOp", true);
LOG_CMD_OUTPUT = MODCONFIG.getOrDefault("cmd.logCmdOutput", false);
SimpleConfig.LOGGER.info("All " + modconfigs.getConfigsList().size() + " have been set properly");
}