Java Code Examples for net.minecraftforge.common.config.Configuration#load()

The following examples show how to use net.minecraftforge.common.config.Configuration#load() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IGWSupportNotifier.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Needs to be instantiated somewhere in your mod's loading stage.
 */
public IGWSupportNotifier(){
    if(FMLCommonHandler.instance().getSide() == Side.CLIENT && !Loader.isModLoaded("IGWMod")) {
        File dir = new File(".", "config");
        Configuration config = new Configuration(new File(dir, "IGWMod.cfg"));
        config.load();

        if(config.get(Configuration.CATEGORY_GENERAL, "enable_missing_notification", true, "When enabled, this will notify players when IGW-Mod is not installed even though mods add support.").getBoolean()) {
            ModContainer mc = Loader.instance().activeModContainer();
            String modid = mc.getModId();
            List<ModContainer> loadedMods = Loader.instance().getActiveModList();
            for(ModContainer container : loadedMods) {
                if(container.getModId().equals(modid)) {
                    supportingMod = container.getName();
                    FMLCommonHandler.instance().bus().register(this);
                    ClientCommandHandler.instance.registerCommand(new CommandDownloadIGW());
                    break;
                }
            }
        }
        config.save();
    }
}
 
Example 2
Source File: IGWSupportNotifier.java    From IGW-mod with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Needs to be instantiated somewhere in your mod's loading stage.
 */
public IGWSupportNotifier(){
    if(FMLCommonHandler.instance().getSide() == Side.CLIENT && !Loader.isModLoaded("IGWMod")) {
        File dir = new File(".", "config");
        Configuration config = new Configuration(new File(dir, "IGWMod.cfg"));
        config.load();

        if(config.get(Configuration.CATEGORY_GENERAL, "enable_missing_notification", true, "When enabled, this will notify players when IGW-Mod is not installed even though mods add support.").getBoolean()) {
            ModContainer mc = Loader.instance().activeModContainer();
            String modid = mc.getModId();
            List<ModContainer> loadedMods = Loader.instance().getActiveModList();
            for(ModContainer container : loadedMods) {
                if(container.getModId().equals(modid)) {
                    supportingMod = container.getName();
                    MinecraftForge.EVENT_BUS.register(this);
                    ClientCommandHandler.instance.registerCommand(new CommandDownloadIGW());
                    break;
                }
            }
        }
        config.save();
    }
}
 
Example 3
Source File: Config.java    From Logistics-Pipes-2 with MIT License 6 votes vote down vote up
/**
 * Read the config file ordered by Category
 * @throws Exception to Log when sth goes wrong
 */
public static void readConfig(){
	Configuration cfg = CommonProxy.config;
	
	try{
		cfg.load();
		initGeneral(cfg);
		initNetwork(cfg);
		initWorld(cfg);
	}
	catch(Exception e){
		LogisticsPipes2.logger.log(Level.ERROR, "There was a Problem reading the Config File!");
	}
	finally{
		if(cfg.hasChanged()){
			cfg.save();
		}
	}
}
 
Example 4
Source File: MainHelmetHandler.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void saveToConfig(){
    Configuration config = Config.config;
    config.load();
    if(powerStat != null) {
        config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Power_Stat", "stat X", -1).set(powerStat.getBaseX());
        config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Power_Stat", "stat Y", 2).set(powerStat.getBaseY());
        config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Power_Stat", "stat leftsided", true).set(powerStat.isLeftSided());
        powerStatX = powerStat.getBaseX();
        powerStatY = powerStat.getBaseY();
        powerStatLeftSided = powerStat.isLeftSided();
    }
    if(testMessageStat != null) {
        config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Message_Stat", "stat X", 2).set(testMessageStat.getBaseX());
        config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Message_Stat", "stat Y", 2).set(testMessageStat.getBaseY());
        config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Message_Stat", "stat leftsided", false).set(testMessageStat.isLeftSided());
        messagesStatX = testMessageStat.getBaseX();
        messagesStatY = testMessageStat.getBaseY();
        messagesStatLeftSided = testMessageStat.isLeftSided();
        messagesStatX = testMessageStat.getBaseX();
        messagesStatY = testMessageStat.getBaseY();
        messagesStatLeftSided = testMessageStat.isLeftSided();
    }
    config.save();
}
 
Example 5
Source File: ConfigHandler.java    From IGW-mod with GNU General Public License v2.0 5 votes vote down vote up
public static void init(File configFile){
    conf = new Configuration(configFile);
    conf.load();
    shouldShowTooltip = conf.get(Configuration.CATEGORY_GENERAL, "Should show tooltip", true).getBoolean(true);
    debugMode = conf.get(Configuration.CATEGORY_GENERAL, "Debug mode", false).getBoolean(false);
    conf.save();
}
 
Example 6
Source File: YouTubeConfiguration.java    From youtube-chat-for-minecraft with Apache License 2.0 5 votes vote down vote up
private YouTubeConfiguration(File path) {
  config = new Configuration(path);
  config.load();
  addGeneralConfig();
  if (config.hasChanged()) {
    config.save();
  }
}
 
Example 7
Source File: CyberwareConfig.java    From Cyberware with MIT License 5 votes vote down vote up
public static void preInit(FMLPreInitializationEvent event)
{
	configDirectory = event.getModConfigurationDirectory();
	config = new Configuration(new File(event.getModConfigurationDirectory(), Cyberware.MODID + ".cfg"));
	startingItems = defaultStartingItems = new String[EnumSlot.values().length][0];
	startingStacks = new ItemStack[EnumSlot.values().length][LibConstants.WARE_PER_SLOT];
	
	int j = 0;
	for (int i = 0; i < EnumSlot.values().length; i++)
	{
		if (EnumSlot.values()[i].hasEssential())
		{
			if (EnumSlot.values()[i].isSided())
			{
				defaultStartingItems[i] = new String[] { "cyberware:bodyPart 1 " + j, "cyberware:bodyPart 1 " + (j + 1)  };
				j += 2;
			}
			else
			{
				defaultStartingItems[i] = new String[] { "cyberware:bodyPart 1 " + j };
				j++;
			}
		}
		else
		{
			defaultStartingItems[i] = new String[0];
		}
	}
	loadConfig();
	
	config.load();
	for (int index = 0; index < EnumSlot.values().length; index++)
	{
		EnumSlot slot = EnumSlot.values()[index];
		startingItems[index] = config.getStringList("Default augments for " + slot.getName() + " slot",
				"Defaults", defaultStartingItems[index], "Use format 'id amount metadata'");
	}
	config.save();
	
}
 
Example 8
Source File: Config.java    From ExNihiloAdscensio with MIT License 5 votes vote down vote up
public static void doNormalConfig(File file)
{
	Configuration config = new Configuration(file);
	
	config.load();
	
	enableBarrels = config.get("Mechanics", "barrels", true).getBoolean();
	enableCrucible = config.get("Mechanics", "crucible", true).getBoolean();
	shouldBarrelsFillWithRain = config.get("Mechanics", "barrelsFillWithRain", true).getBoolean();
	fakePlayersCanSieve = config.get("Mechanics", "fakePlayersCanSieve", false).getBoolean();
	
	compostingTicks = config.get("Composting", "ticksToFormDirt", 600).getInt();
	
	infestedLeavesTicks = config.get("Infested Leaves","ticksToTransform",600).getInt();
       leavesUpdateFrequency = config.get("Infested Leaves", "leavesUpdateFrequency", 40).getInt();
       leavesSpreadChance = config.get("Infested Leaves", "leavesSpreadChance", 0.0015).getDouble();
       doLeavesUpdateClient = config.get("Infested Leaves", "doLeavesUpdateClient", true).getBoolean();
	
       enableBarrelTransformLighting = config.get("Misc", "enableBarrelTransformLighting", true).getBoolean();
       
	stringChance = config.get("Crooking", "stringChance", 1).getDouble();
	stringFortuneChance = config.get("Crooking", "stringFortuneChance", 1).getDouble();
	
	sieveSimilarRadius = config.get("Sieving", "sieveSimilarRadius", 2).getInt();
	
	doEnderIOCompat = config.get("Compatibilitiy", "EnderIO", true).getBoolean();
	doTICCompat = config.get("Compatibilitiy", "TinkersConstruct", true).getBoolean();
	doTOPCompat = config.get("Compatibilitiy", "TheOneProbe", true).getBoolean();
	shouldOreDictOreChunks = config.get("Compatibilitiy", "OreDictOreChunks", true).getBoolean();
	shouldOreDictOreDusts = config.get("Compatibilitiy", "OreDictOreDusts", true).getBoolean();
	
	setFireToMacroUsers = config.get("Sieving", "setFireToMacroUsers", false).getBoolean();
	sievesAutoOutput = config.get("Sieving", "sievesAutoOutput", false).getBoolean();
	
	numberOfTimesToTestVanillaDrops = config.get("Crooking", "numberOfVanillaDropRuns", 3).getInt();
	
	if (config.hasChanged())
		config.save();
}
 
Example 9
Source File: CoordTrackUpgradeHandler.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@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();
}
 
Example 10
Source File: BlockTrackUpgradeHandler.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@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();
}
 
Example 11
Source File: ConfigReader.java    From enderutilities with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void loadConfigsFromFile(File configFile)
{
    configurationFile = configFile;
    config = new Configuration(configurationFile, null, true);
    config.load();
    reLoadAllConfigs(false);
}
 
Example 12
Source File: NBTEdit.java    From NBTEdit with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event){
	ModMetadata modMeta = event.getModMetadata();
	modMeta.authorList = Arrays.asList(new String[] { "Davidee" });
	modMeta.autogenerated = false;
	modMeta.credits = "Thanks to Mojang, Forge, and all your support.";
	modMeta.description = "Allows you to edit NBT Tags in-game.\nPlease visit the URL above for help.";
	modMeta.url = "http://www.minecraftforum.net/topic/1558668-151/";
	
	
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	config.load();
	opOnly = config.get("General", "opOnly", true, "true if only Ops can NBTEdit; false allows users in creative mode to NBTEdit").getBoolean(true);
	config.save();
}
 
Example 13
Source File: EntityTrackUpgradeHandler.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@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();
}
 
Example 14
Source File: SearchUpgradeHandler.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void saveToConfig(){
    Configuration config = Config.config;
    config.load();
    config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Item_Search", "stat X", -1).set(searchInfo.getBaseX());
    config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Item_Search", "stat Y", 17).set(searchInfo.getBaseY());
    config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Item_Search", "stat leftsided", true).set(searchInfo.isLeftSided());
    config.save();
    statX = searchInfo.getBaseX();
    statY = searchInfo.getBaseY();
    statLeftSided = searchInfo.isLeftSided();
}
 
Example 15
Source File: QCraft.java    From qcraft-mod with Apache License 2.0 4 votes vote down vote up
@Mod.EventHandler
public void preInit( FMLPreInitializationEvent event )
{
    // Load config

    Configuration config = new Configuration( event.getSuggestedConfigurationFile() );
    config.load();

    // Setup general

    Property prop = config.get( Configuration.CATEGORY_GENERAL, "enableQBlockOcclusionTesting", enableQBlockOcclusionTesting );
    prop.comment = "Set whether QBlocks should not be observed if their line of sight to the player is obstructed. WARNING: This has a very high performance cost if you have lots of QBlocks in your world!!";
    enableQBlockOcclusionTesting = prop.getBoolean( enableQBlockOcclusionTesting );

    prop = config.get( Configuration.CATEGORY_GENERAL, "enableWorldGen", enableWorldGen );
    prop.comment = "Set whether Quantum Ore will spawn in new chunks";
    enableWorldGen = prop.getBoolean( enableWorldGen );

    prop = config.get( Configuration.CATEGORY_GENERAL, "enableWorldGenReplacementRecipes", enableWorldGenReplacementRecipes );
    prop.comment = "Set whether Quantum Dust can be crafted instead of mined";
    enableWorldGenReplacementRecipes = prop.getBoolean( enableWorldGenReplacementRecipes );

    prop = config.get( Configuration.CATEGORY_GENERAL, "letAdminsCreatePortals", letAdminsCreatePortals );
    prop.comment = "Set whether server admins can energize portals";
    letAdminsCreatePortals = prop.getBoolean( letAdminsCreatePortals );

    prop = config.get( Configuration.CATEGORY_GENERAL, "letPlayersCreatePortals", letPlayersCreatePortals );
    prop.comment = "Set whether players can energize portals.";
    letPlayersCreatePortals = prop.getBoolean( letPlayersCreatePortals );

    prop = config.get( Configuration.CATEGORY_GENERAL, "letAdminsEditPortalServerList", letAdminsEditPortalServerList );
    prop.comment = "Set whether server admins can edit the list of Servers which portals can teleport to";
    letAdminsEditPortalServerList = prop.getBoolean( letAdminsEditPortalServerList );

    prop = config.get( Configuration.CATEGORY_GENERAL, "letPlayersEditPortalServerList", letPlayersEditPortalServerList );
    prop.comment = "Set whether players can edit the list of Servers which portals can teleport to";
    letPlayersEditPortalServerList = prop.getBoolean( letPlayersEditPortalServerList );

    prop = config.get( Configuration.CATEGORY_GENERAL, "letAdminsVerifyPortalServers", letAdminsVerifyPortalServers );
    prop.comment = "Set whether server admins can verify an inter-server portal link";
    letAdminsVerifyPortalServers = prop.getBoolean( letAdminsVerifyPortalServers );

    prop = config.get( Configuration.CATEGORY_GENERAL, "letPlayersVerifyPortalServers", letPlayersVerifyPortalServers );
    prop.comment = "Set whether players can verify an inter-server portal link";
    letPlayersVerifyPortalServers = prop.getBoolean( letPlayersVerifyPortalServers );
    
    prop = config.get( Configuration.CATEGORY_GENERAL, "maxPortalSize", maxPortalSize );
    prop.comment = "Set the maximum height and width for the Quantum Portal inside the frame in blocks. [min: 3, max: 16, def: 5]";
    int temp = prop.getInt( maxPortalSize );
    if (temp < 3) {
        maxPortalSize = 3;
    } else if (temp > 16) {
        maxPortalSize = 16;
    } else {
        maxPortalSize = prop.getInt( maxPortalSize );
    }
    prop.set(maxPortalSize);
    
    prop = config.get( Configuration.CATEGORY_GENERAL, "maxQTPSize", maxQTPSize );
    prop.comment = "Set the maximum distance from the Quantum Computer that the quantization or teleportation field can extend in blocks. (3 means that there are 2 blocks between the computer and the pillar) [min: 1, max: 16, def: 8]";
    temp = prop.getInt( maxQTPSize );
    if (temp < 1) {
        maxQTPSize = 1;
    } else if (temp > 16) {
        maxQTPSize = 16;
    } else {
        maxQTPSize = prop.getInt( maxQTPSize );
    }
    prop.set(maxQTPSize);
    //if more configs like these last two get added, it might be a good idea to include a method that checks the maximum and minimum instead of copying code over and over

    // None

    // Save config
    config.save();

    // Setup network
    networkEventChannel = NetworkRegistry.INSTANCE.newEventDrivenChannel( "qCraft" );
    networkEventChannel.register( new PacketHandler() );

    proxy.preLoad();
}
 
Example 16
Source File: Settings.java    From MediaMod with GNU General Public License v3.0 4 votes vote down vote up
public static void loadConfig() {
    Configuration configuration = new Configuration(configFile);
    configuration.load();
    updateConfig(configuration, true);
}
 
Example 17
Source File: TraverseConfig.java    From Traverse-Legacy-1-12-2 with MIT License 4 votes vote down vote up
private TraverseConfig() {
	config = new Configuration(mainConfig);
	config.load();

	useVanillaWood = config.get(Configuration.CATEGORY_GENERAL, "useVanillaWood", useVanillaWood, "Use vanilla logs for Traverse trees (might not look as nice)").getBoolean();
	registerBiomesRegardless = config.get(Configuration.CATEGORY_GENERAL, "registerBiomesRegardless", registerBiomesRegardless, "All biomes will always be registered, ignoring the instance traverse_world_data (WARNING: This will cause ugly world generation borders at the edge of what has previously been generated and what is new!!)").getBoolean();
	disableCustomSkies = config.get(Configuration.CATEGORY_GENERAL, "disableCustomSkies", disableCustomSkies, "When true, Traverse will only use the default sky colour.").getBoolean();
	vanillaCanyonBlocks = config.get(Configuration.CATEGORY_GENERAL, "vanillaCanyonBlocks", vanillaCanyonBlocks, "Use vanilla Red Sandstone instead of Red Rock in the Canyon biome.").getBoolean();
	findBiomeCommandTimeout = config.get(Configuration.CATEGORY_GENERAL, "findBiomeCommandTimeout", findBiomeCommandTimeout, "How long, in ms, the /findbiome command will search for biomes before timing out, normally 20000ms").getInt();
	disallowVillages = config.get(Configuration.CATEGORY_GENERAL, "disallowVillages", disallowVillages, "With this enabled, villages will not spawn in Traverse biomes").getBoolean();
	disallowBoulders = config.get(Configuration.CATEGORY_GENERAL, "disallowBoulders", disallowBoulders, "With this enabled, cobblestone boulder formations will not spawn in Traverse biomes").getBoolean();

	disableAutumnalWoods = config.get(CATEGORY_BIOMES, "disableAutumnalWoods", disableAutumnalWoods, "Force disable the Autumnal Woods biome").getBoolean();
	disableWoodlands = config.get(CATEGORY_BIOMES, "disableWoodlands", disableWoodlands, "Force disable the Woodlands biome").getBoolean();
	disableMiniJungle = config.get(CATEGORY_BIOMES, "disableMiniJungle", disableMiniJungle, "Force disable the Mini Jungle biome").getBoolean();
	disableMeadow = config.get(CATEGORY_BIOMES, "disableMeadow", disableMeadow, "Force disable the Meadow biome").getBoolean();
	disableLushSwamp = config.get(CATEGORY_BIOMES, "disableLushSwamp", disableLushSwamp, "Force disable the Lush Swamp biome").getBoolean();
	disableRedDesert = config.get(CATEGORY_BIOMES, "disableRedDesert", disableRedDesert, "Force disable the Red Desert biome").getBoolean();
	disableTemperateRainforest = config.get(CATEGORY_BIOMES, "disableTemperateRainforest", disableTemperateRainforest, "Force disable the Temperate Rainforest biome").getBoolean();
	disableBadlands = config.get(CATEGORY_BIOMES, "disableBadlands", disableBadlands, "Force disable the Badlands biome").getBoolean();
	disableMountainousDesert = config.get(CATEGORY_BIOMES, "disableMountainousDesert", disableMountainousDesert, "Force disable the Mountainous Desert biome").getBoolean();
	disableRockyPlateau = config.get(CATEGORY_BIOMES, "disableRockyPlateau", disableRockyPlateau, "Force disable the Rocky Plateau biome").getBoolean();
	disableForestedHills = config.get(CATEGORY_BIOMES, "disableForestedHills", disableForestedHills, "Force disable the Forested Hills biome").getBoolean();
	disableBirchForestedHills = config.get(CATEGORY_BIOMES, "disableBirchForestedHills", disableBirchForestedHills, "Force disable the Birch Forested Hills biome").getBoolean();
	disableAutumnalWoodedHills = config.get(CATEGORY_BIOMES, "disableAutumnalWoodedHills", disableAutumnalWoodedHills, "Force disable the Autumnal Wooded Hills biome").getBoolean();
	disableCliffs = config.get(CATEGORY_BIOMES, "disableCliffs", disableCliffs, "Force disable the Cliffs biome").getBoolean();
	disableGlacier = config.get(CATEGORY_BIOMES, "disableGlacier", disableGlacier, "Force disable the Glacier biome").getBoolean();
	disableGlacierSpikes = config.get(CATEGORY_BIOMES, "disableGlacierSpikes", disableGlacierSpikes, "Force disable the Glacier Spikes biome").getBoolean();
	disableSnowyConiferousForest = config.get(CATEGORY_BIOMES, "disableSnowyConiferousForest", disableSnowyConiferousForest, "Force disable the Snowy Coniferous Forest biome").getBoolean();
	disableLushHills = config.get(CATEGORY_BIOMES, "disableLushHills", disableLushHills, "Force disable the Lush Hills biome").getBoolean();
	disableCanyon = config.get(CATEGORY_BIOMES, "disableCanyon", disableCanyon, "Force disable the Canyon biome").getBoolean();
	disableCragCliffs = config.get(CATEGORY_BIOMES, "disableCragCliffs", disableCragCliffs, "Force disable the Crag Cliffs biome").getBoolean();
	disableDesertShrubland = config.get(CATEGORY_BIOMES, "disableDesertShrubland", disableDesertShrubland, "Force disable the Desert Shrubland biome").getBoolean();
	disableThicket = config.get(CATEGORY_BIOMES, "disableThicket", disableThicket, "Force disable the Thicket biome").getBoolean();
	disableAridHighland = config.get(CATEGORY_BIOMES, "disableAridHighland", disableAridHighland, "Force disable the Arid Highland biome").getBoolean();
	disableRockyPlains = config.get(CATEGORY_BIOMES, "disableRockyPlains", disableRockyPlains, "Force disable the Rocky Plains biome").getBoolean();

	enableNewTextures = config.get(Configuration.CATEGORY_CLIENT, "enableNewTextures", enableNewTextures, "Enable the new Traverse textures in the newer minecraft style").getBoolean();

	config.save();
}
 
Example 18
Source File: TraverseConfig.java    From CommunityMod with GNU Lesser General Public License v2.1 4 votes vote down vote up
private TraverseConfig() {
	config = new Configuration(mainConfig);
	config.load();

	useVanillaWood = config.get(Configuration.CATEGORY_GENERAL, "useVanillaWood", useVanillaWood, "Use vanilla logs for Traverse trees (might not look as nice)").getBoolean();
	registerBiomesRegardless = config.get(Configuration.CATEGORY_GENERAL, "registerBiomesRegardless", registerBiomesRegardless, "All biomes will always be registered, ignoring the instance traverse_world_data (WARNING: This will cause ugly world generation borders at the edge of what has previously been generated and what is new!!)").getBoolean();
	disableCustomSkies = config.get(Configuration.CATEGORY_GENERAL, "disableCustomSkies", disableCustomSkies, "When true, Traverse will only use the default sky colour.").getBoolean();
	vanillaCanyonBlocks = config.get(Configuration.CATEGORY_GENERAL, "vanillaCanyonBlocks", vanillaCanyonBlocks, "Use vanilla Red Sandstone instead of Red Rock in the Canyon biome.").getBoolean();
	findBiomeCommandTimeout = config.get(Configuration.CATEGORY_GENERAL, "findBiomeCommandTimeout", findBiomeCommandTimeout, "How long, in ms, the /findbiome command will search for biomes before timing out, normally 20000ms").getInt();
	disallowVillages = config.get(Configuration.CATEGORY_GENERAL, "disallowVillages", disallowVillages, "With this enabled, villages will not spawn in Traverse biomes").getBoolean();
	disallowBoulders = config.get(Configuration.CATEGORY_GENERAL, "disallowBoulders", disallowBoulders, "With this enabled, cobblestone boulder formations will not spawn in Traverse biomes").getBoolean();

	disableAutumnalWoods = config.get(CATEGORY_BIOMES, "disableAutumnalWoods", disableAutumnalWoods, "Force disable the Autumnal Woods biome").getBoolean();
	disableWoodlands = config.get(CATEGORY_BIOMES, "disableWoodlands", disableWoodlands, "Force disable the Woodlands biome").getBoolean();
	disableMiniJungle = config.get(CATEGORY_BIOMES, "disableMiniJungle", disableMiniJungle, "Force disable the Mini Jungle biome").getBoolean();
	disableMeadow = config.get(CATEGORY_BIOMES, "disableMeadow", disableMeadow, "Force disable the Meadow biome").getBoolean();
	disableLushSwamp = config.get(CATEGORY_BIOMES, "disableLushSwamp", disableLushSwamp, "Force disable the Lush Swamp biome").getBoolean();
	disableRedDesert = config.get(CATEGORY_BIOMES, "disableRedDesert", disableRedDesert, "Force disable the Red Desert biome").getBoolean();
	disableTemperateRainforest = config.get(CATEGORY_BIOMES, "disableTemperateRainforest", disableTemperateRainforest, "Force disable the Temperate Rainforest biome").getBoolean();
	disableBadlands = config.get(CATEGORY_BIOMES, "disableBadlands", disableBadlands, "Force disable the Badlands biome").getBoolean();
	disableMountainousDesert = config.get(CATEGORY_BIOMES, "disableMountainousDesert", disableMountainousDesert, "Force disable the Mountainous Desert biome").getBoolean();
	disableRockyPlateau = config.get(CATEGORY_BIOMES, "disableRockyPlateau", disableRockyPlateau, "Force disable the Rocky Plateau biome").getBoolean();
	disableForestedHills = config.get(CATEGORY_BIOMES, "disableForestedHills", disableForestedHills, "Force disable the Forested Hills biome").getBoolean();
	disableBirchForestedHills = config.get(CATEGORY_BIOMES, "disableBirchForestedHills", disableBirchForestedHills, "Force disable the Birch Forested Hills biome").getBoolean();
	disableAutumnalWoodedHills = config.get(CATEGORY_BIOMES, "disableAutumnalWoodedHills", disableAutumnalWoodedHills, "Force disable the Autumnal Wooded Hills biome").getBoolean();
	disableCliffs = config.get(CATEGORY_BIOMES, "disableCliffs", disableCliffs, "Force disable the Cliffs biome").getBoolean();
	disableGlacier = config.get(CATEGORY_BIOMES, "disableGlacier", disableGlacier, "Force disable the Glacier biome").getBoolean();
	disableGlacierSpikes = config.get(CATEGORY_BIOMES, "disableGlacierSpikes", disableGlacierSpikes, "Force disable the Glacier Spikes biome").getBoolean();
	disableSnowyConiferousForest = config.get(CATEGORY_BIOMES, "disableSnowyConiferousForest", disableSnowyConiferousForest, "Force disable the Snowy Coniferous Forest biome").getBoolean();
	disableLushHills = config.get(CATEGORY_BIOMES, "disableLushHills", disableLushHills, "Force disable the Lush Hills biome").getBoolean();
	disableCanyon = config.get(CATEGORY_BIOMES, "disableCanyon", disableCanyon, "Force disable the Canyon biome").getBoolean();
	disableCragCliffs = config.get(CATEGORY_BIOMES, "disableCragCliffs", disableCragCliffs, "Force disable the Crag Cliffs biome").getBoolean();
	disableDesertShrubland = config.get(CATEGORY_BIOMES, "disableDesertShrubland", disableDesertShrubland, "Force disable the Desert Shrubland biome").getBoolean();
	disableThicket = config.get(CATEGORY_BIOMES, "disableThicket", disableThicket, "Force disable the Thicket biome").getBoolean();
	disableAridHighland = config.get(CATEGORY_BIOMES, "disableAridHighland", disableAridHighland, "Force disable the Arid Highland biome").getBoolean();
	disableRockyPlains = config.get(CATEGORY_BIOMES, "disableRockyPlains", disableRockyPlains, "Force disable the Rocky Plains biome").getBoolean();

	enableNewTextures = config.get(Configuration.CATEGORY_CLIENT, "enableNewTextures", enableNewTextures, "Enable the new Traverse textures in the newer minecraft style").getBoolean();

	config.save();
}
 
Example 19
Source File: ModConfig.java    From Gadomancy with GNU Lesser General Public License v3.0 3 votes vote down vote up
public static void init(File file) {
    config = new Configuration(file);

    config.load();

    loadFromConfig();

    config.save();
}
 
Example 20
Source File: Config.java    From CraftingKeys with MIT License 3 votes vote down vote up
/**
 * Initializes the configFile Files, loads all values (or sets them to default).
 *
 * @param event PreInitEvent from Main Class
 */
public static void loadConfig(FMLPreInitializationEvent event) {

    configFile = new Configuration(event.getSuggestedConfigurationFile(), CraftingKeys.VERSION);

    configFile.load();

    genComments();

    syncConfig();

}