Rearrange some of the configuration options

This commit is contained in:
Pahimar 2016-05-27 22:37:19 -04:00
parent c3c6724fea
commit d4ed4bbacb
2 changed files with 19 additions and 30 deletions

View File

@ -16,6 +16,7 @@ public class ConfigurationHandler {
private static final String CATEGORY_SOUND = "general.sound";
private static final String CATEGORY_ENERGY_VALUE = "general.energy_value";
private static final String CATEGORY_PLAYER_KNOWLEDGE = "general.player_knowledge";
private static final String CATEGORY_SERVER = "general.server";
public static void init(File configFile) {
@ -28,13 +29,13 @@ public class ConfigurationHandler {
private static void loadConfiguration() {
Settings.serverSyncThreshold = configuration.getInt(
Settings.ENERGY_VALUE_SYNC_THRESHOLD_NAME,
CATEGORY_ENERGY_VALUE,
Settings.ENERGY_VALUE_SYNC_THRESHOLD_DEFAULT,
Settings.ENERGY_VALUE_SYNC_THRESHOLD_MIN,
Settings.ENERGY_VALUE_SYNC_THRESHOLD_MAX,
StatCollector.translateToLocal(Settings.ENERGY_VALUE_SYNC_THRESHOLD_COMMENT),
Settings.ENERGY_VALUE_SYNC_THRESHOLD_LABEL);
Settings.SERVER_SYNC_THRESHOLD_NAME,
CATEGORY_SERVER,
Settings.SERVER_SYNC_THRESHOLD_DEFAULT,
Settings.SERVER_SYNC_THRESHOLD_MIN,
Settings.SERVER_SYNC_THRESHOLD_MAX,
StatCollector.translateToLocal(Settings.SERVER_SYNC_THRESHOLD_COMMENT),
Settings.SERVER_SYNC_THRESHOLD_LABEL);
Settings.regenerateEnergyValuesWhen = ConfigurationHelper.getString(configuration,
Settings.ENERGY_VALUE_REGENERATE_WHEN_NAME,
@ -66,13 +67,6 @@ public class ConfigurationHandler {
StatCollector.translateToLocal(Settings.USE_PLAYER_KNOWLEDGE_TEMPLATE_COMMENT),
Settings.USE_PLAYER_KNOWLEDGE_TEMPLATE_LABEL);
Settings.onlyLoadFile = configuration.getBoolean(
Settings.ABILITIES_ONLY_LOAD_FILE_NAME,
Configuration.CATEGORY_GENERAL,
false,
StatCollector.translateToLocal(Settings.ABILITIES_ONLY_LOAD_FILE_COMMENT),
Settings.ABILITIES_ONLY_LOAD_FILE_LABEL);
if (configuration.hasChanged()) {
configuration.save();
}
@ -89,12 +83,12 @@ public class ConfigurationHandler {
public static class Settings {
public static int serverSyncThreshold;
private static final String ENERGY_VALUE_SYNC_THRESHOLD_NAME = "sync_threshold";
private static final String ENERGY_VALUE_SYNC_THRESHOLD_LABEL = "energy_value.sync_threshold.label";
private static final String ENERGY_VALUE_SYNC_THRESHOLD_COMMENT = "energy_value.sync_threshold.comment";
private static final int ENERGY_VALUE_SYNC_THRESHOLD_DEFAULT = 5;
private static final int ENERGY_VALUE_SYNC_THRESHOLD_MIN = 0;
private static final int ENERGY_VALUE_SYNC_THRESHOLD_MAX = Short.MAX_VALUE;
private static final String SERVER_SYNC_THRESHOLD_NAME = "sync_threshold";
private static final String SERVER_SYNC_THRESHOLD_LABEL = "server.sync_threshold.label";
private static final String SERVER_SYNC_THRESHOLD_COMMENT = "server.sync_threshold.comment";
private static final int SERVER_SYNC_THRESHOLD_DEFAULT = 5;
private static final int SERVER_SYNC_THRESHOLD_MIN = 0;
private static final int SERVER_SYNC_THRESHOLD_MAX = Short.MAX_VALUE;
public static String regenerateEnergyValuesWhen;
private static final String ENERGY_VALUE_REGENERATE_WHEN_NAME = "regenerate_values_when";
@ -121,10 +115,5 @@ public class ConfigurationHandler {
private static final String USE_PLAYER_KNOWLEDGE_TEMPLATE_LABEL = "player_knowledge.use_template.label";
private static final String USE_PLAYER_KNOWLEDGE_TEMPLATE_COMMENT = "player_knowledge.use_template.comment";
private static final boolean USE_PLAYER_KNOWLEDGE_TEMPLATE_DEFAULT = true;
public static boolean onlyLoadFile;
private static final String ABILITIES_ONLY_LOAD_FILE_NAME = "abilities.onlyLoadFile";
private static final String ABILITIES_ONLY_LOAD_FILE_LABEL = "general.abilities.onlyLoadFile.label";
private static final String ABILITIES_ONLY_LOAD_FILE_COMMENT = "general.abilities.onlyLoadFile.comment";
}
}

View File

@ -1,7 +1,5 @@
# Configuration (Energy Value Options)
energy_value=Energy Value Options
energy_value.sync_threshold.label=Sync Threshold
energy_value.sync_threshold.comment=The number of seconds a player must wait before they can sync their energy values for objects with the server again
energy_value.regenerate_values_when.label=Regenerate Energy Values When
energy_value.regenerate_values_when.comment=When to regenerate energy values for objects. Options are "Always" (every time Minecraft starts) or "As Needed" (whenever the mod cannot the calculated energy values file).
energy_value.debug_logging_enabled.label=Enable Debug Logging
@ -17,8 +15,10 @@ player_knowledge=Player Knowledge Options
player_knowledge.use_template.label=Use Knowledge Template
player_knowledge.use_template.comment=Whether or not to use the player knowledge template. The template allows players to start with some items already researched
general.abilities.onlyLoadFile.label=Only load Abilities file
general.abilities.onlyLoadFile.comment=Setting this to true means that Abilities are initially only loaded from file, rather than from both file and from other mods
# Server Options
server=Server Options
server.sync_threshold.label=Sync Threshold
server.sync_threshold.comment=The number of seconds a player must wait before they can sync their energy values for objects with the server again
# Keys
key.categories.ee3=Equivalent Exchange 3
@ -89,7 +89,7 @@ tile.ee3:alchemicalFuelBlock.alchemicalCoal.name=Block of Alchemical Coal
tile.ee3:alchemicalFuelBlock.mobiusFuel.name=Block of Mobius Fuel
tile.ee3:alchemicalFuelBlock.aeternalisFuel.name=Block of Aeternalis Fuel
tile.ee3:aludel.name=Aludel Base
tile.ee3:calcinator.name=Calcinator
tile.ee3:calcinator.name=Calciner
tile.ee3:chalk.name=Chalk
tile.ee3:glassBell.name=Glass Bell
tile.ee3:researchStation.name=Research Station