Search in sources :

Example 1 with Configuration

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();
}
Also used : Configuration(net.minecraftforge.common.config.Configuration)

Example 2 with Configuration

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();
}
Also used : Configuration(net.minecraftforge.common.config.Configuration)

Example 3 with Configuration

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();
}
Also used : Configuration(net.minecraftforge.common.config.Configuration)

Example 4 with Configuration

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();
}
Also used : Configuration(net.minecraftforge.common.config.Configuration) File(java.io.File) IOException(java.io.IOException)

Example 5 with Configuration

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());
}
Also used : Configuration(net.minecraftforge.common.config.Configuration) Config(com.bluepowermod.init.Config) BPEventHandler(com.bluepowermod.event.BPEventHandler) WorldConversionEventHandler(com.bluepowermod.convert.WorldConversionEventHandler) RedstoneProviderQmunityLib(com.bluepowermod.redstone.RedstoneProviderQmunityLib) BPEventHandler(com.bluepowermod.event.BPEventHandler) WorldConversionEventHandler(com.bluepowermod.convert.WorldConversionEventHandler) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Aggregations

Configuration (net.minecraftforge.common.config.Configuration)39 File (java.io.File)14 EventHandler (net.minecraftforge.fml.common.Mod.EventHandler)5 EventHandler (cpw.mods.fml.common.Mod.EventHandler)4 IOException (java.io.IOException)2 Property (net.minecraftforge.common.config.Property)2 ModMetadata (net.minecraftforge.fml.common.ModMetadata)2 AgriConfigAdapter (com.agricraft.agricore.config.AgriConfigAdapter)1 WorldConversionEventHandler (com.bluepowermod.convert.WorldConversionEventHandler)1 BPEventHandler (com.bluepowermod.event.BPEventHandler)1 Config (com.bluepowermod.init.Config)1 RedstoneProviderQmunityLib (com.bluepowermod.redstone.RedstoneProviderQmunityLib)1 ProxyASMTest (com.builtbroken.mc.core.asm.ProxyASMTest)1 ItemDevData (com.builtbroken.mc.core.content.debug.ItemDevData)1 ItemInstaHole (com.builtbroken.mc.core.content.debug.ItemInstaHole)1 TileInfInv (com.builtbroken.mc.core.content.debug.TileInfInv)1 ItemScrewdriver (com.builtbroken.mc.core.content.tool.ItemScrewdriver)1 ItemSelectionWand (com.builtbroken.mc.core.content.tool.ItemSelectionWand)1 ToolModeGeneral (com.builtbroken.mc.core.content.tool.screwdriver.ToolModeGeneral)1 ToolModeRotation (com.builtbroken.mc.core.content.tool.screwdriver.ToolModeRotation)1