Skip to content

Commit

Permalink
Move the pages to a different part of the config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethryan committed Sep 27, 2023
1 parent e3073b6 commit ca971bf
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/main/java/serverutils/aurora/AuroraConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class AuroraConfig {
public static Configuration config;
public static final AuroraConfig INST = new AuroraConfig();
public static final String GEN_CAT = Configuration.CATEGORY_GENERAL;
public static final String PAGES_CAT = "Pages";

public static void init(FMLPreInitializationEvent event) {
config = new Configuration(new File(event.getModConfigurationDirectory() + "/../server utilities/aurora.cfg"));
Expand All @@ -27,52 +28,54 @@ public static boolean sync() {
general.port = config.get(GEN_CAT, "port", 48574, "Webserver Port ID, Default: 48574", 1025, 65534).getInt();
general.modlist_page = config
.get(
GEN_CAT,
PAGES_CAT,
"modlist_page",
"ENABLED",
"Enable the modlist page, Default: ENABLED, Valid values: ENABLED, REQUIRES_AUTH, DISABLED")
.getString();
general.world_info_json = config
.get(
GEN_CAT,
PAGES_CAT,
"world_info_json",
"ENABLED",
"Enable the world info page, Default: ENABLED, Valid values: ENABLED, REQUIRES_AUTH, DISABLED")
.getString();;
general.player_list_table = config.get(
GEN_CAT,
PAGES_CAT,
"player_list_table",
"ENABLED",
"Enable the playerlist table page, Default: ENABLED, Valid values: ENABLED, REQUIRES_AUTH, DISABLED")
.getString();
general.player_list_json = config.get(
GEN_CAT,
PAGES_CAT,
"player_list_json",
"ENABLED",
"Enable the playerlist json page, Default: ENABLED, Valid values: ENABLED, REQUIRES_AUTH, DISABLED")
.getString();
general.player_rank_page = config.get(
GEN_CAT,
PAGES_CAT,
"player_rank_page",
"REQUIRES_AUTH",
"Enable the player rank page from Server Utilities, Default: REQUIRES_AUTH, Valid values: ENABLED, REQUIRES_AUTH, DISABLED")
.getString();
general.command_list_page = config.get(
GEN_CAT,
PAGES_CAT,
"command_list_page",
"ENABLED",
"Enable the command list page from Server Utilities, Default: ENABLED, Valid values: ENABLED, REQUIRES_AUTH, DISABLED")
.getString();
general.permission_list_page = config.get(
GEN_CAT,
PAGES_CAT,
"permission_list_page",
"ENABLED",
"Enable the permission list page from Server Utilities, Default: ENABLED, Valid values: ENABLED, REQUIRES_AUTH, DISABLED")
.getString();

general.modlist_excluded_mods = config
.get("modlist_excluded_mods", GEN_CAT, new String[] {}, "Exclude mods from the modlist: Default: Empty")
.getStringList();
general.modlist_excluded_mods = config.get(
PAGES_CAT,
"modlist_excluded_mods",
new String[] {},
"Exclude mods from the modlist: Default: Empty").getStringList();

config.save();
return true;
Expand Down

0 comments on commit ca971bf

Please sign in to comment.