ActuallyAdditions/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java

46 lines
2.1 KiB
Java
Raw Normal View History

2015-03-07 12:51:28 +01:00
package ellpeck.actuallyadditions.config;
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
import ellpeck.actuallyadditions.config.values.ConfigCrafting;
import ellpeck.actuallyadditions.config.values.ConfigFloatValues;
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
import net.minecraftforge.common.config.Configuration;
public class ConfigValues{
public static ConfigCrafting[] craftingConfig = ConfigCrafting.values();
public static boolean[] craftingValues = new boolean[craftingConfig.length];
public static ConfigIntValues[] intConfig = ConfigIntValues.values();
public static int[] intValues = new int[intConfig.length];
public static ConfigFloatValues[] floatConfig = ConfigFloatValues.values();
public static float[] floatValues = new float[floatConfig.length];
public static ConfigBoolValues[] boolConfig = ConfigBoolValues.values();
public static boolean[] boolValues = new boolean[boolConfig.length];
2015-04-19 01:50:02 +02:00
public static void defineConfigValues(Configuration config){
for(int i = 0; i < craftingValues.length; i++){
ConfigCrafting currConf = craftingConfig[i];
craftingValues[i] = config.getBoolean(currConf.name, currConf.category, currConf.defaultValue, "If the Crafting Recipe for the " + currConf.name + " is Enabled");
2015-03-31 20:37:55 +02:00
}
for(int i = 0; i < intValues.length; i++){
ConfigIntValues currConf = intConfig[i];
intValues[i] = config.getInt(currConf.name, currConf.category, currConf.defaultValue, currConf.min, currConf.max, currConf.desc);
}
2015-03-31 20:37:55 +02:00
for(int i = 0; i < floatValues.length; i++){
ConfigFloatValues currConf = floatConfig[i];
floatValues[i] = config.getFloat(currConf.name, currConf.category, currConf.defaultValue, currConf.min, currConf.max, currConf.desc);
}
2015-04-19 01:50:02 +02:00
for(int i = 0; i < boolValues.length; i++){
ConfigBoolValues currConf = boolConfig[i];
boolValues[i] = config.getBoolean(currConf.name, currConf.category, currConf.defaultValue, currConf.desc);
}
}
}