refactored some config related parts

This commit is contained in:
2017-01-04 03:24:21 +01:00
parent a8c066ed1b
commit 9e54f0e62a
3 changed files with 9 additions and 12 deletions

View File

@@ -108,16 +108,13 @@ public class TAIGAConfiguration {
final int PALLADIUM_DEFAULT = 10;
final int ABYSSUM_DEFAULT = 4;
final boolean FALSE = false;
final boolean TRUE = true;
Property ironSwitch = config.get(CATEGORY_NAME_GENERAL, "Extra Iron Switch", FALSE);
ironSwitch.setComment("Switch ore on/off");
Property ironSwitch = config.get(CATEGORY_NAME_GENERAL, "Additional Iron", false);
ironSwitch.setComment("Switch additional ore on/off");
ironSwitch.setLanguageKey("gui.taiga_configuration.gen_iron");
Property endSwitch = config.get(CATEGORY_NAME_GENERAL, "Extra Endstone Switch", TRUE);
endSwitch.setComment("Switch extra End on/off");
Property endSwitch = config.get(CATEGORY_NAME_GENERAL, "Additional Endstone", true);
endSwitch.setComment("Switch additional endstone on/off");
endSwitch.setLanguageKey("gui.taiga_configuration.gen_end");
/*
@@ -197,8 +194,8 @@ public class TAIGAConfiguration {
if (readFieldsFromConfig) {
ironGen = ironSwitch.getBoolean(FALSE);
endGen = endSwitch.getBoolean(TRUE);
ironGen = ironSwitch.getBoolean(false);
endGen = endSwitch.getBoolean(true);
IRON_VAL = ironValueProp.getInt(IRON_DEFAULT);
if (IRON_VAL > RESFAC_MAX_VALUE || IRON_VAL < RESFAC_MIN_VALUE) {
IRON_VAL = IRON_DEFAULT;
@@ -266,6 +263,7 @@ public class TAIGAConfiguration {
}
ironSwitch.set(ironGen);
endSwitch.set(endGen);
ironValueProp.set(IRON_VAL);
tiberiumValueProp.set(TIBERIUM_VAL);
prometheumValueProp.set(PROMETHEUM_VAL);

View File

@@ -43,8 +43,8 @@ public class TAIGAGuiFactory implements IModGuiFactory {
private static List<IConfigElement> getConfigElements() {
List<IConfigElement> list = new ArrayList<IConfigElement>();
list.add(new DummyConfigElement.DummyCategoryElement("Basics configuration", "gui.taiga_configuration.ctgy.general", CategoryEntryGeneral.class));
list.add(new DummyConfigElement.DummyCategoryElement("Specific ore generation", "gui.taiga_configuration.ctgy.oregen", CategoryEntryOreGen.class));
list.add(new DummyConfigElement.DummyCategoryElement("Basic configuration", "gui.taiga_configuration.ctgy.general", CategoryEntryGeneral.class));
list.add(new DummyConfigElement.DummyCategoryElement("Ore specific settings", "gui.taiga_configuration.ctgy.oregen", CategoryEntryOreGen.class));
return list;
}

View File

@@ -24,7 +24,6 @@ public class WorldGen implements IWorldGenerator {
Generator.generateOre(Blocks.NETHERRACK.getDefaultState(), prometheumOre.getDefaultState(), random, x, z, world, PROMETHEUM_VAL, 0, 128, 2, 4);
Generator.generateOre(Blocks.NETHERRACK.getDefaultState(), valyriumOre.getDefaultState(), random, x, z, world, VALYRIUM_VAL, 0, 32, 2, 4);
Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15);
}
private void world(Random random, int x, int z, World world) {