mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 16:58:34 +01:00
Made the Config File and screen less ugly
This commit is contained in:
parent
a7e63fc174
commit
e1af56faf2
5 changed files with 27 additions and 27 deletions
|
@ -12,25 +12,25 @@ package ellpeck.actuallyadditions.config;
|
||||||
|
|
||||||
public enum ConfigCategories{
|
public enum ConfigCategories{
|
||||||
|
|
||||||
FOOD_CRAFTING("food crafting", "Crafting Recipes for Food Items"),
|
FOOD_CRAFTING("Food Crafting", "Crafting Recipes for Food Items"),
|
||||||
BLOCKS_CRAFTING("block crafting", "Crafting Recipes for Blocks"),
|
BLOCKS_CRAFTING("Block Crafting", "Crafting Recipes for Blocks"),
|
||||||
ITEMS_CRAFTING("item crafting", "Crafting Recipes for Items"),
|
ITEMS_CRAFTING("Item Crafting", "Crafting Recipes for Items"),
|
||||||
TOOL_VALUES("tool values", "Values for Tools"),
|
TOOL_VALUES("Tool Values", "Values for Tools"),
|
||||||
MACHINE_VALUES("machine values", "Values for Machines"),
|
MACHINE_VALUES("Machine Values", "Values for Machines"),
|
||||||
MOB_DROPS("mob drops", "Everything regarding Item drops from mobs"),
|
MOB_DROPS("Mob Drops", "Everything regarding Item drops from mobs"),
|
||||||
WORLD_GEN("world gen", "Everything regarding World Generation"),
|
WORLD_GEN("World Gen", "Everything regarding World Generation"),
|
||||||
POTION_RING_CRAFTING("ring crafting", "Crafting Recipes for Rings"),
|
POTION_RING_CRAFTING("Ring Crafting", "Crafting Recipes for Rings"),
|
||||||
OTHER("other", "Everything else"),
|
OTHER("Other", "Everything else"),
|
||||||
FLUIDS("fluids", "Everything regarding fluids"),
|
FLUIDS("Fluids", "Everything regarding fluids"),
|
||||||
DRILL_VALUES("drill values", "Properties of Drills and their Upgrades"),
|
DRILL_VALUES("Drill Values", "Properties of Drills and their Upgrades"),
|
||||||
CRUSHER_RECIPES("crusher recipes", "Recipes for the Crusher"),
|
CRUSHER_RECIPES("Crusher Recipes", "Recipes for the Crusher"),
|
||||||
ARMOR_VALUES("armor values", "Values for Armor");
|
ARMOR_VALUES("Armor Values", "Values for Armor");
|
||||||
|
|
||||||
public final String name;
|
public final String name;
|
||||||
public final String comment;
|
public final String comment;
|
||||||
|
|
||||||
ConfigCategories(String name, String comment){
|
ConfigCategories(String name, String comment){
|
||||||
this.name = name.toLowerCase();
|
this.name = name;
|
||||||
this.comment = comment;
|
this.comment = comment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,23 +35,23 @@ public class ConfigValues{
|
||||||
public static void defineConfigValues(Configuration config){
|
public static void defineConfigValues(Configuration config){
|
||||||
|
|
||||||
for(ConfigCrafting currConf : craftingConfig){
|
for(ConfigCrafting currConf : craftingConfig){
|
||||||
currConf.currentValue = config.getBoolean(currConf.name, currConf.category.toLowerCase(), currConf.defaultValue, "If the "+currConf.extraText+"Crafting Recipe for the "+currConf.name+" is Enabled");
|
currConf.currentValue = config.get(currConf.category, currConf.name, currConf.defaultValue, "If the "+currConf.extraText+"Crafting Recipe for the "+currConf.name+" is Enabled").getBoolean();
|
||||||
}
|
}
|
||||||
for(ConfigIntValues currConf : intConfig){
|
for(ConfigIntValues currConf : intConfig){
|
||||||
currConf.currentValue = config.getInt(currConf.name, currConf.category.toLowerCase(), currConf.defaultValue, currConf.min, currConf.max, currConf.desc);
|
currConf.currentValue = config.get(currConf.category, currConf.name, currConf.defaultValue, currConf.desc, currConf.min, currConf.max).getInt();
|
||||||
}
|
}
|
||||||
for(ConfigFloatValues currConf : floatConfig){
|
for(ConfigFloatValues currConf : floatConfig){
|
||||||
currConf.currentValue = config.getFloat(currConf.name, currConf.category.toLowerCase(), currConf.defaultValue, currConf.min, currConf.max, currConf.desc);
|
currConf.currentValue = (float)config.get(currConf.category, currConf.name, currConf.defaultValue, currConf.desc, currConf.min, currConf.max).getDouble();
|
||||||
}
|
}
|
||||||
for(ConfigBoolValues currConf : boolConfig){
|
for(ConfigBoolValues currConf : boolConfig){
|
||||||
currConf.currentValue = config.getBoolean(currConf.name, currConf.category.toLowerCase(), currConf.defaultValue, currConf.desc);
|
currConf.currentValue = config.get(currConf.category, currConf.name, currConf.defaultValue, currConf.desc).getBoolean();
|
||||||
}
|
}
|
||||||
|
|
||||||
crusherRecipeExceptions = config.getStringList("Crusher Recipe Exceptions", ConfigCategories.CRUSHER_RECIPES.name, new String[]{"ingotBrick", "ingotBrickNether"}, "The Ingots, Dusts and Ores blacklisted from being auto-registered to be crushed by the Crusher. This list uses OreDictionary Names of the Inputs only.");
|
crusherRecipeExceptions = config.get(ConfigCategories.CRUSHER_RECIPES.name, "Crusher Recipe Exceptions", new String[]{"ingotBrick", "ingotBrickNether"}, "The Ingots, Dusts and Ores blacklisted from being auto-registered to be crushed by the Crusher. This list uses OreDictionary Names of the Inputs only.").getStringList();
|
||||||
mashedFoodCraftingExceptions = config.getStringList("Mashed Food Crafting Exceptions", ConfigCategories.ITEMS_CRAFTING.name, new String[]{"ActuallyAdditions:itemCoffee"}, "The ItemFood, IGrowable and IPlantable Items that can not be used to craft Mashed Food. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.");
|
mashedFoodCraftingExceptions = config.get(ConfigCategories.ITEMS_CRAFTING.name, "Mashed Food Crafting Exceptions", new String[]{"ActuallyAdditions:itemCoffee"}, "The ItemFood, IGrowable and IPlantable Items that can not be used to craft Mashed Food. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.").getStringList();
|
||||||
oreMagnetExceptions = config.getStringList("Ore Magnet Exceptions", ConfigCategories.MACHINE_VALUES.name, new String[0], "By default, the Ore Magnet pulls up everything that is registered in the OreDictionary as a String that starts with 'ore'. If you want any Ore not to be pulled up by the Magnet, put its ORE DICTIONARY name here.");
|
oreMagnetExceptions = config.get(ConfigCategories.MACHINE_VALUES.name, "Ore Magnet Exceptions", new String[0], "By default, the Ore Magnet pulls up everything that is registered in the OreDictionary as a String that starts with 'ore'. If you want any Ore not to be pulled up by the Magnet, put its ORE DICTIONARY name here.").getStringList();
|
||||||
oreMagnetExtraWhitelist = config.getStringList("Ore Magnet Extra Whitelist", ConfigCategories.MACHINE_VALUES.name, new String[]{"rftools:dimensionalShardBlock"}, "By default, the Ore Magnet pulls up everything that is registered in the OreDictionary as a String that starts with 'ore'. If you want anything else to be pulled up by the Magnet, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.");
|
oreMagnetExtraWhitelist = config.get(ConfigCategories.MACHINE_VALUES.name, "Ore Magnet Extra Whitelist", new String[]{"rftools:dimensionalShardBlock"}, "By default, the Ore Magnet pulls up everything that is registered in the OreDictionary as a String that starts with 'ore'. If you want anything else to be pulled up by the Magnet, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.").getStringList();
|
||||||
paxelExtraMiningWhitelist = config.getStringList("AIOT Extra Whitelist", ConfigCategories.TOOL_VALUES.name, new String[]{"TConstruct:GravelOre"}, "By default, the AIOT can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.");
|
paxelExtraMiningWhitelist = config.get(ConfigCategories.TOOL_VALUES.name, "AIOT Extra Whitelist", new String[]{"TConstruct:GravelOre"}, "By default, the AIOT can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.").getStringList();
|
||||||
drillExtraminingWhitelist = config.getStringList("Drill Extra Whitelist", ConfigCategories.TOOL_VALUES.name, new String[]{"TConstruct:GravelOre"}, "By default, the Drill can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.");
|
drillExtraminingWhitelist = config.get(ConfigCategories.TOOL_VALUES.name, "Drill Extra Whitelist", new String[]{"TConstruct:GravelOre"}, "By default, the Drill can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.").getStringList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class ConfigurationHandler{
|
||||||
Util.registerEvent(this);
|
Util.registerEvent(this);
|
||||||
|
|
||||||
if(config == null){
|
if(config == null){
|
||||||
config = new Configuration(configFile);
|
config = new Configuration(configFile, true);
|
||||||
loadConfig();
|
loadConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ import java.util.List;
|
||||||
public class GuiConfiguration extends GuiConfig{
|
public class GuiConfiguration extends GuiConfig{
|
||||||
|
|
||||||
public GuiConfiguration(GuiScreen parentScreen){
|
public GuiConfiguration(GuiScreen parentScreen){
|
||||||
super(parentScreen, getConfigElements(), ModUtil.MOD_ID, false, false, ModUtil.NAME);
|
super(parentScreen, getConfigElements(), ModUtil.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(ConfigurationHandler.config.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<IConfigElement> getConfigElements(){
|
private static List<IConfigElement> getConfigElements(){
|
||||||
|
|
|
@ -162,7 +162,7 @@ public enum ConfigIntValues{
|
||||||
ORE_MAGNET_OIL_USE("Ore Magnet: Oil Use", ConfigCategories.MACHINE_VALUES, 30, 0, 5000, "The amount of oil the Ore Magnet uses every Block"),
|
ORE_MAGNET_OIL_USE("Ore Magnet: Oil Use", ConfigCategories.MACHINE_VALUES, 30, 0, 5000, "The amount of oil the Ore Magnet uses every Block"),
|
||||||
ORE_MAGNET_ENERGY_USE("Ore Magnet: Energy USe", ConfigCategories.MACHINE_VALUES, 250, 10, 10000, "The amount of Energy the Ore Magnet uses every tick"),
|
ORE_MAGNET_ENERGY_USE("Ore Magnet: Energy USe", ConfigCategories.MACHINE_VALUES, 250, 10, 10000, "The amount of Energy the Ore Magnet uses every tick"),
|
||||||
|
|
||||||
LEAF_GENERATOR_ENERGY_PRODUCED("Leaf Generator: Energy Produce", ConfigCategories.MACHINE_VALUES, 20, 1, 10000, "How much Energy the Leaf Generator produces per Leaf broken"),
|
LEAF_GENERATOR_ENERGY_PRODUCED("Leaf Generator: Energy Produce", ConfigCategories.MACHINE_VALUES, 40, 1, 10000, "How much Energy the Leaf Generator produces per Leaf broken"),
|
||||||
LEAF_GENERATOR_COOLDOWN_TIME("Leaf Generator: Cooldown Time", ConfigCategories.MACHINE_VALUES, 5, 0, 100, "The amount of ticks that it takes util another Leaf gets proken"),
|
LEAF_GENERATOR_COOLDOWN_TIME("Leaf Generator: Cooldown Time", ConfigCategories.MACHINE_VALUES, 5, 0, 100, "The amount of ticks that it takes util another Leaf gets proken"),
|
||||||
LEAF_GENERATOR_RANGE("Leaf Generator: Range", ConfigCategories.MACHINE_VALUES, 5, 1, 100, "The radius of a leaf generator");
|
LEAF_GENERATOR_RANGE("Leaf Generator: Range", ConfigCategories.MACHINE_VALUES, 5, 1, 100, "The radius of a leaf generator");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue