use of net.minecraftforge.common.config.Configuration in project PneumaticCraft by MineMaarten.
the class BlockTrackUpgradeHandler method saveToConfig.
@Override
public void saveToConfig() {
Configuration config = Config.config;
config.load();
config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Block_Tracker", "stat X", -1).set(blockTrackInfo.getBaseX());
config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Block_Tracker", "stat Y", 46).set(blockTrackInfo.getBaseY());
config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Block_Tracker", "stat leftsided", true).set(blockTrackInfo.isLeftSided());
statX = blockTrackInfo.getBaseX();
statY = blockTrackInfo.getBaseY();
statLeftSided = blockTrackInfo.isLeftSided();
config.save();
}
use of net.minecraftforge.common.config.Configuration in project PneumaticCraft by MineMaarten.
the class CoordTrackUpgradeHandler method saveToConfig.
@Override
public void saveToConfig() {
Configuration config = Config.config;
config.load();
config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Coordinate_Tracker", "Path Enabled", true).set(pathEnabled);
config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Coordinate_Tracker", "Wire Path", true).set(wirePath);
config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Coordinate_Tracker", "X-Ray", true).set(xRayEnabled);
config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Coordinate_Tracker", "Path Update Rate", true).set(pathUpdateSetting);
config.save();
}
use of net.minecraftforge.common.config.Configuration in project PneumaticCraft by MineMaarten.
the class EntityTrackUpgradeHandler method saveToConfig.
@Override
public void saveToConfig() {
Configuration config = Config.config;
config.load();
config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Entity_Tracker", "stat X", -1).set(entityTrackInfo.getBaseX());
config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Entity_Tracker", "stat Y", 90).set(entityTrackInfo.getBaseY());
config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Entity_Tracker", "stat leftsided", true).set(entityTrackInfo.isLeftSided());
statX = entityTrackInfo.getBaseX();
statY = entityTrackInfo.getBaseY();
statLeftSided = entityTrackInfo.isLeftSided();
config.save();
}
use of net.minecraftforge.common.config.Configuration in project MinecraftForge by MinecraftForge.
the class ForgeChunkManager method captureConfig.
static void captureConfig(File configDir) {
cfgFile = new File(configDir, "forgeChunkLoading.cfg");
config = new Configuration(cfgFile, true);
try {
config.load();
} catch (Exception e) {
File dest = new File(cfgFile.getParentFile(), "forgeChunkLoading.cfg.bak");
if (dest.exists()) {
dest.delete();
}
cfgFile.renameTo(dest);
FMLLog.log(Level.ERROR, e, "A critical error occurred reading the forgeChunkLoading.cfg file, defaults will be used - the invalid file is backed up at forgeChunkLoading.cfg.bak");
}
syncConfigDefaults();
}
use of net.minecraftforge.common.config.Configuration in project BluePower by Qmunity.
the class BluePower method preInit.
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
event.getModMetadata().version = Refs.fullVersionString();
log = event.getModLog();
config = new Configuration(event.getSuggestedConfigurationFile());
BPApi.init(new BluePowerAPI());
// Load configs
Config.syncConfig(config);
BPEnchantments.init();
CompatibilityUtils.preInit(event);
FMLCommonHandler.instance().bus().register(new Config());
BPEventHandler eventHandler = new BPEventHandler();
MinecraftForge.EVENT_BUS.register(eventHandler);
FMLCommonHandler.instance().bus().register(eventHandler);
MinecraftForge.EVENT_BUS.register(new WorldConversionEventHandler());
RedstoneApi.getInstance().registerRedstoneProvider(new RedstoneProviderQmunityLib());
}
Aggregations