2015-03-07 12:51:28 +01:00
|
|
|
package ellpeck.actuallyadditions.config;
|
2015-02-09 17:25:05 +01:00
|
|
|
|
2015-07-01 21:32:48 +02:00
|
|
|
import ellpeck.actuallyadditions.util.ModUtil;
|
2015-02-09 17:25:05 +01:00
|
|
|
import net.minecraftforge.common.config.Configuration;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
public class ConfigurationHandler{
|
|
|
|
|
2015-06-18 13:14:57 +02:00
|
|
|
public static final String ISSUES_WARNING = " [THIS COULD CAUSE ISSUES, CHANGE AT YOUR OWN RISK!]";
|
|
|
|
|
2015-02-09 17:25:05 +01:00
|
|
|
public static void init(File configFile){
|
2015-07-01 21:32:48 +02:00
|
|
|
ModUtil.LOGGER.info("Grabbing Configurations...");
|
2015-02-09 17:25:05 +01:00
|
|
|
Configuration config = new Configuration(configFile);
|
|
|
|
|
|
|
|
try{
|
|
|
|
config.load();
|
|
|
|
ConfigValues.defineConfigValues(config);
|
|
|
|
}
|
|
|
|
catch(Exception e){
|
2015-07-03 00:21:20 +02:00
|
|
|
ModUtil.LOGGER.error("Loading the Config File failed!", e);
|
2015-02-09 17:25:05 +01:00
|
|
|
}
|
|
|
|
finally{
|
2015-03-30 15:08:19 +02:00
|
|
|
if(config.hasChanged()){
|
|
|
|
config.save();
|
|
|
|
}
|
2015-02-09 17:25:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2015-03-30 15:08:19 +02:00
|
|
|
}
|