2015-03-07 12:51:28 +01:00
package ellpeck.actuallyadditions.config ;
2015-02-09 17:25:05 +01:00
2015-04-24 19:22:03 +02:00
import ellpeck.actuallyadditions.config.values.ConfigBoolValues ;
import ellpeck.actuallyadditions.config.values.ConfigCrafting ;
import ellpeck.actuallyadditions.config.values.ConfigFloatValues ;
import ellpeck.actuallyadditions.config.values.ConfigIntValues ;
2015-02-09 17:25:05 +01:00
import net.minecraftforge.common.config.Configuration ;
public class ConfigValues {
2015-04-24 19:22:03 +02:00
public static ConfigCrafting [ ] craftingConfig = ConfigCrafting . values ( ) ;
public static boolean [ ] craftingValues = new boolean [ craftingConfig . length ] ;
2015-02-09 17:25:05 +01:00
2015-04-24 19:22:03 +02:00
public static ConfigIntValues [ ] intConfig = ConfigIntValues . values ( ) ;
public static int [ ] intValues = new int [ intConfig . length ] ;
2015-02-17 16:15:16 +01:00
2015-04-24 19:22:03 +02:00
public static ConfigFloatValues [ ] floatConfig = ConfigFloatValues . values ( ) ;
public static float [ ] floatValues = new float [ floatConfig . length ] ;
2015-02-17 16:15:16 +01:00
2015-04-24 19:22:03 +02:00
public static ConfigBoolValues [ ] boolConfig = ConfigBoolValues . values ( ) ;
public static boolean [ ] boolValues = new boolean [ boolConfig . length ] ;
2015-04-19 01:50:02 +02:00
2015-02-09 17:25:05 +01:00
public static void defineConfigValues ( Configuration config ) {
2015-04-24 19:22:03 +02:00
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
}
2015-04-24 19:22:03 +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
2015-04-24 19:22:03 +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
2015-04-24 19:22:03 +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 ) ;
}
2015-02-09 17:25:05 +01:00
}
}