Java Code Examples for net.minecraftforge.common.config.Property#getBoolean()

The following examples show how to use net.minecraftforge.common.config.Property#getBoolean() . 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: PLConfig.java    From Production-Line with MIT License 6 votes vote down vote up
public static void init(File configFile) {
    instance = new PLConfig(configFile);

    if (!configFile.exists()) {
        gtiLogger.log(Level.ERROR, "Cannot create ProductionLine config file");
        gtiLogger.log(Level.INFO, "Skipping config load");
    } else {
        instance.load();

        Property throwableUran238 = instance.get(CATEGORY_GENERAL, "ThrowableUran238", true);
        throwableUran238.setComment("Allow throw uranium 238, was hit after the radiation effect");
        instance.throwableUran238 = throwableUran238.getBoolean();

        Property throwablePackagedSalt = instance.get(CATEGORY_GENERAL, "ThrowablePackagedSalt", true);
        throwablePackagedSalt.setComment("Allow throw uranium 238, was hit after the salty effect");
        instance.throwablePackagedSalt = throwablePackagedSalt.getBoolean();

        instance.explosiveFurnace = instance.get(CATEGORY_GENERAL, "ExplosiveFurnace", true).getBoolean();

        instance.save();
    }
    gtiLogger.log(Level.INFO, "ProductionLine config loaded");
}
 
Example 2
Source File: TFCOptions.java    From TFC2 with GNU General Public License v3.0 6 votes vote down vote up
public static boolean getBooleanFor(Configuration config,String heading, String item, boolean value, String comment)
{
	if (config == null)
		return value;
	try
	{
		Property prop = config.get(heading, item, value);
		prop.setComment(comment);
		return prop.getBoolean(value);
	}
	catch (Exception e)
	{
		System.out.println("[TFC2] Error while trying to add Integer, config wasn't loaded properly!");
	}
	return value;
}
 
Example 3
Source File: ConfigManager.java    From GardenCollection with MIT License 6 votes vote down vote up
public ConfigManager (File file) {
    config = new Configuration(file);

    Property propEnableCompostBonemeal = config.get(Configuration.CATEGORY_GENERAL, "enableCompostBonemeal", true);
    propEnableCompostBonemeal.comment = "Allows compost trigger plant growth like bonemeal.";
    enableCompostBonemeal = propEnableCompostBonemeal.getBoolean();

    Property propCompostBonemealStrength = config.get(Configuration.CATEGORY_GENERAL, "compostBonemealStrength", 0.5);
    propCompostBonemealStrength.comment = "The probability that compost will succeed when used as bonemeal relative to bonemeal.";
    compostBonemealStrength = propCompostBonemealStrength.getDouble();

    Property propEnableTilledSoilGrowthBonus = config.get(Configuration.CATEGORY_GENERAL, "enableTilledSoilGrowthBonus", true).setRequiresMcRestart(true);
    propEnableTilledSoilGrowthBonus.comment = "Allows tilled garden soil to advance crop growth more quickly.  Enables random ticks.";
    enableTilledSoilGrowthBonus = propEnableTilledSoilGrowthBonus.getBoolean();

    config.save();
}
 
Example 4
Source File: ConfigurableFeatureManager.java    From OpenModsLib with MIT License 6 votes vote down vote up
public Table<String, String, Property> loadFromConfiguration(Configuration config) {
	final Table<String, String, Property> properties = HashBasedTable.create();
	for (Table.Cell<String, String, FeatureEntry> cell : features.cellSet()) {
		final FeatureEntry entry = cell.getValue();
		if (!entry.isConfigurable) continue;

		final String categoryName = cell.getRowKey();
		final String featureName = cell.getColumnKey();
		final Property prop = config.get(categoryName, featureName, entry.isEnabled);
		properties.put(categoryName, featureName, prop);
		if (!prop.wasRead()) continue;

		if (!prop.isBooleanValue()) prop.set(entry.isEnabled);
		else entry.isEnabled = prop.getBoolean(entry.isEnabled);
	}

	return ImmutableTable.copyOf(properties);
}
 
Example 5
Source File: ModConfigs.java    From LookingGlass with GNU General Public License v3.0 5 votes vote down vote up
public static void loadConfigs(Configuration config) {
	Property off = config.get(CATAGORY_SERVER, "disabled", disabled);
	off.comment = "On the client this disables other world renders entirely, preventing world requests. On the server this disables sending world info to all clients.";
	disabled = off.getBoolean(disabled);

	Property d = config.get(CATAGORY_SERVER, "datarate", dataRate);
	d.comment = "The number of bytes to send per tick before the server cuts off sending. Only applies to other-world chunks. Default: " + dataRate;
	dataRate = d.getInt(dataRate);

	if (dataRate <= 0) disabled = true;

	if (config.hasChanged()) config.save();
}
 
Example 6
Source File: Config.java    From Levels with GNU General Public License v2.0 5 votes vote down vote up
private static void syncMain()
{
	String category = "main";
	List<String> propOrder = Lists.newArrayList();
	Property prop;
	
	/*
	 * Experience
	 */
	prop = main.get(category, "maxLevel", maxLevel);
	prop.setComment("Determines the max level of weapons and armor.");
	maxLevel = prop.getDouble();
	propOrder.add(prop.getName());
	
	prop = main.get(category, "experienceExponent", expExponent);
	prop.setComment("Sets the exponent of the experience algorithm.");
	expExponent = prop.getDouble();
	propOrder.add(prop.getName());
	
	prop = main.get(category, "experienceMultiplier", expMultiplier);
	prop.setComment("Sets the multiplier of the experience algorithm.");
	expMultiplier = prop.getInt();
	propOrder.add(prop.getName());
	
	/*
	 * Miscellaneous
	 */
	prop = main.get(category, "itemBlacklist", itemBlacklist);
	prop.setComment("Items in this blacklist will not gain the leveling systems. Useful for very powerful items or potential conflicts. Style should be 'modid:item'");
	itemBlacklist = prop.getStringList();
	propOrder.add(prop.getName());
	
	prop = main.get(category, "unlimitedDurability", unlimitedDurability);
	prop.setComment("Determines whether or not weapons and armor will lose durability.");
	unlimitedDurability = prop.getBoolean();
	propOrder.add(prop.getName());
	
	main.setCategoryPropertyOrder(category, propOrder);
	main.save();
}
 
Example 7
Source File: TFCOptions.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
public static boolean getBooleanFor(Configuration config,String heading, String item, boolean value)
{
	if (config == null)
		return value;
	try
	{
		Property prop = config.get(heading, item, value);
		return prop.getBoolean(value);
	}
	catch (Exception e)
	{
		System.out.println("[TFC2] Error while trying to add Integer, config wasn't loaded properly!");
	}
	return value;
}
 
Example 8
Source File: ConfigManager.java    From GardenCollection with MIT License 5 votes vote down vote up
public ConfigManager (File file) {
    config = new Configuration(file);

    Property propStrangePlantDrops = config.get(Configuration.CATEGORY_GENERAL, "strangePlantDrops", new String[0]);
    propStrangePlantDrops.comment = "A list of zero or more item IDs.  Breaking the plant will drop an item picked at random from the list.  Ex: minecraft:coal:1";

    Property propStrangePlantDropChance = config.get(Configuration.CATEGORY_GENERAL, "strangePlantDropChance", 1.0);
    propStrangePlantDropChance.comment = "The probability from 0.0 - 1.0 that breaking a strange plant will drop its contents.";
    strangePlantDropChance = propStrangePlantDropChance.getDouble();

    Property propStrangePlantDropMin = config.get(Configuration.CATEGORY_GENERAL, "strangePlantDropMin", 1);
    propStrangePlantDropMin.comment = "The minimum number of items dropped when breaking a strange plant.";
    strangePlantDropMin = propStrangePlantDropMin.getInt();

    Property propStrangePlantDropMax = config.get(Configuration.CATEGORY_GENERAL, "strangePlantDropMax", 1);
    propStrangePlantDropMax.comment = "The maximum number of items dropped when breaking a strange plant.";
    strangePlantDropMax = propStrangePlantDropMax.getInt();

    Property propCompostGrowsOrnamentalTrees = config.get(Configuration.CATEGORY_GENERAL, "compostGrowsOrnamentalTrees", true);
    propCompostGrowsOrnamentalTrees.comment = "Using compost on saplings will grow ornamental (miniature) trees instead of normal trees.";
    compostGrowsOrnamentalTrees = propCompostGrowsOrnamentalTrees.getBoolean();

    Property propGenerateCandelilla = config.get(Configuration.CATEGORY_GENERAL, "generateCandelilla", true);
    propGenerateCandelilla.comment = "Generates clusters of candelilla shrub in warm, sandy biomes.";
    generateCandelilla = propGenerateCandelilla.getBoolean();

    config.save();
}
 
Example 9
Source File: Settings.java    From MediaMod with GNU General Public License v3.0 4 votes vote down vote up
private static void updateConfig(Configuration configuration, boolean load) {
    Property enabledProperty = configuration.get("General", "enabled", true);
    Property showPlayerProperty = configuration.get("General", "showPlayer", true);
    Property modernPlayerProperty = configuration.get("Player", "modernPlayer", true);
    Property albumArtProperty = configuration.get("Player", "showAlbumArt", true);
    Property autoColorProperty = configuration.get("Player", "automaticColorSelection", true);
    Property saveSpotifyTokenProperty = configuration.get("General", "saveSpotifyToken", true);
    Property announceTracksProperty = configuration.get("Player", "announceTracks", true);
    Property playerXProperty = configuration.get("Player", "playerX", 5.0);
    Property playerYProperty = configuration.get("Player", "playerY", 5.0);
    Property playerZoomProperty = configuration.get("Player", "playerZoom", 1.0);
    Property browserExtProperty = configuration.get("Player", "useBrowserExtension", true);
    Property progressStyleProperty = configuration.get("Player", "progressStyle", ProgressStyle.BAR_AND_NUMBERS_NEW.name());
    Property refreshTokenProperty = configuration.get("Spotify", "refreshToken", "");

    if (load) SAVE_SPOTIFY_TOKEN = saveSpotifyTokenProperty.getBoolean();
    else saveSpotifyTokenProperty.setValue(SAVE_SPOTIFY_TOKEN);

    if (load) REFRESH_TOKEN = refreshTokenProperty.getString();
    else {
        if(SAVE_SPOTIFY_TOKEN) {
            refreshTokenProperty.setValue(REFRESH_TOKEN);
        } else {
            refreshTokenProperty.setValue("");
        }
    }

    if (load) ENABLED = enabledProperty.getBoolean();
    else enabledProperty.setValue(ENABLED);

    if (load) ANNOUNCE_TRACKS = announceTracksProperty.getBoolean();
    else announceTracksProperty.setValue(ANNOUNCE_TRACKS);

    if (load) PROGRESS_STYLE = ProgressStyle.valueOf(progressStyleProperty.getString());
    else progressStyleProperty.setValue(PROGRESS_STYLE.name());

    if (load) SHOW_PLAYER = showPlayerProperty.getBoolean();
    else showPlayerProperty.setValue(SHOW_PLAYER);

    if (load) MODERN_PLAYER_STYLE = modernPlayerProperty.getBoolean();
    else modernPlayerProperty.setValue(MODERN_PLAYER_STYLE);

    if (load) SHOW_ALBUM_ART = albumArtProperty.getBoolean();
    else albumArtProperty.setValue(SHOW_ALBUM_ART);

    if (load) AUTO_COLOR_SELECTION = autoColorProperty.getBoolean();
    else autoColorProperty.setValue(AUTO_COLOR_SELECTION);

    if (load) PLAYER_X = playerXProperty.getDouble();
    else playerXProperty.setValue(PLAYER_X);

    if (load) PLAYER_Y = playerYProperty.getDouble();
    else playerYProperty.setValue(PLAYER_Y);

    if (load) PLAYER_ZOOM = playerZoomProperty.getDouble();
    else playerZoomProperty.setValue(PLAYER_ZOOM);

    if (load) EXTENSION_ENABLED = browserExtProperty.getBoolean();
    else browserExtProperty.setValue(EXTENSION_ENABLED);
}
 
Example 10
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 11
Source File: OpenPeripheralIntegration.java    From OpenPeripheral-Integration with MIT License 4 votes vote down vote up
private static boolean checkConfig(Configuration config, String value) {
	final Property property = config.get(CATEGORY_MODULES, value, true);
	property.setRequiresMcRestart(true);
	return property.getBoolean();
}
 
Example 12
Source File: ConfigReader.java    From enderutilities with GNU Lesser General Public License v3.0 4 votes vote down vote up
private static void loadConfigItemControl(Configuration conf)
{
    Property prop;
    currentCategory = "DisableBlocks";
    currentRequiresMcRestart = true;

    conf.addCustomCategoryComment(currentCategory, "Completely disable blocks (don't register them to the game.)\n" +
            "Note that machines are grouped together and identified by the meta value. You can't disable just a specific meta value.");

    // Block disable
    Configs.disableBlockASU           = getProp("disableBlockAdjustableStorageUnit", false).getBoolean();
    Configs.disableBlockBarrel        = getProp("disableBlockBarrel", false).getBoolean();
    Configs.disableBlockDrawbridge    = getProp("disableBlockDrawbridge", false).getBoolean();
    Configs.disableBlockEnderElevator = getProp("disableBlockEnderElevator", false).getBoolean();
    Configs.disableBlockFloor         = getProp("disableBlockFloor", false).getBoolean();
    Configs.disableBlockInserter      = getProp("disableBlockInserter", false).getBoolean();
    Configs.disableBlockMolecularExciter = getProp("disableBlockMolecularExciter", false).getBoolean();
    Configs.disableBlockPhasing       = getProp("disableBlockPhasing", false).getBoolean();
    Configs.disableBlockPortal        = getProp("disableBlockPortal", false).getBoolean();
    Configs.disableBlockPortalFrame   = getProp("disableBlockPortalFrame", false).getBoolean();
    Configs.disableBlockPortalPanel   = getProp("disableBlockPortalPanel", false).getBoolean();
    Configs.disableBlockSoundBlock    = getProp("disableBlockSoundBlock", false).getBoolean();

    prop = getProp("disableBlockEnergyBridge", false);
    prop.setComment("Meta values: 0 = Energy Bridge Resonator; 1 = Energy Bridge Receiver; 2 = Energy Bridge Transmitter");
    Configs.disableBlockEnergyBridge = prop.getBoolean();

    prop = getProp("disableBlockMachine_0", false);
    prop.setComment("Info: Machine_0 meta values: 0 = Ender Furnace");
    Configs.disableBlockMachine_0 = prop.getBoolean();

    prop = getProp("disableBlockMachine_1", false);
    prop.setComment("Info: Machine_1 meta values: 0 = Ender Infuser; 1 = Tool Workstation, 2 = Creation Station");
    Configs.disableBlockMachine_1 = prop.getBoolean();

    prop = getProp("disableBlockStorage_0", false);
    prop.setComment("Meta values: 0..2 = Memory Chests, 3..6 = Handy Chests, 7 = Junk Storage Unit");
    Configs.disableBlockStorage_0 = prop.getBoolean();

    prop = getProp("disableBlockMassiveStorageUnit", false);
    prop.setComment("Meta values: 0 = Massive Storage Unit, 1 = Massive Storage Bundle");
    Configs.disableBlockMSU = prop.getBoolean();

    currentCategory = "DisableItems";
    conf.addCustomCategoryComment(currentCategory, "Completely disable items (don't register them to the game.)\n" +
            "Note that some items are grouped together using the damage value (and/or NBT data) to identify them.\n" +
            "You can't disable a specific damage value only (so that existing items would vanish).");

    // Item disable
    Configs.disableItemCraftingPart           = getProp("disableItemCraftingPart", false).getBoolean();
    Configs.disableItemEnderCapacitor         = getProp("disableItemEnderCapacitor", false).getBoolean();
    Configs.disableItemLinkCrystal            = getProp("disableItemLinkCrystal", false).getBoolean();

    Configs.disableItemBuildersWand           = getProp("disableItemBuildersWand", false).getBoolean();
    Configs.disableItemEnderArrow             = getProp("disableItemEnderArrow", false).getBoolean();
    Configs.disableItemEnderBag               = getProp("disableItemEnderBag", false).getBoolean();
    Configs.disableItemEnderBow               = getProp("disableItemEnderBow", false).getBoolean();
    Configs.disableItemEnderBucket            = getProp("disableItemEnderBucket", false).getBoolean();
    Configs.disableItemEnderLasso             = getProp("disableItemEnderLasso", false).getBoolean();
    Configs.disableItemEnderPearl             = getProp("disableItemEnderPearl", false).getBoolean();
    Configs.disableItemEnderPorter            = getProp("disableItemEnderPorter", false).getBoolean();
    Configs.disableItemEnderSword             = getProp("disableItemEnderSword", false).getBoolean();
    Configs.disableItemEnderTools             = getProp("disableItemEnderTools", false).getBoolean();
    Configs.disableItemHandyBag               = getProp("disableItemHandyBag", false).getBoolean();
    Configs.disableItemIceMelter              = getProp("disableItemIceMelter", false).getBoolean();
    Configs.disableItemInventorySwapper       = getProp("disableItemInventorySwapper", false).getBoolean();
    Configs.disableItemLivingManipulator      = getProp("disableItemLivingManipulator", false).getBoolean();
    Configs.disableItemMobHarness             = getProp("disableItemMobHarness", false).getBoolean();
    Configs.disableItemNullifier              = getProp("disableItemNullifier", false).getBoolean();
    Configs.disableItemPetContract            = getProp("disableItemPetContract", false).getBoolean();
    Configs.disableItemPickupManager          = getProp("disableItemPickupManager", false).getBoolean();
    Configs.disableItemQuickStacker           = getProp("disableItemQuickStacker", false).getBoolean();
    Configs.disableItemPortalScaler           = getProp("disableItemPortalScaler", false).getBoolean();
    Configs.disableItemRuler                  = getProp("disableItemRuler", false).getBoolean();
    Configs.disableItemSyringe                = getProp("disableItemSyringe", false).getBoolean();
    Configs.disableItemVoidPickaxe            = getProp("disableItemVoidPickaxe", false).getBoolean();

    // Recipe disable
    currentCategory = "DisableRecipes";
    conf.addCustomCategoryComment(currentCategory, "Disable item recipes");

    // Blocks
    Configs.disableRecipeEnderElevator        = getProp("disableRecipeEnderElevator", false).getBoolean();
}
 
Example 13
Source File: ConfigManager.java    From GardenCollection with MIT License 4 votes vote down vote up
public ConfigManager (File file) {
    config = new Configuration(file);

    Property propEnableVillagerTrading = config.get(Configuration.CATEGORY_GENERAL, "enableVillagerStampTrading", true);
    propEnableVillagerTrading.comment = "Allows some villagers to buy and sell pattern stamps.";
    enableVillagerTrading = propEnableVillagerTrading.getBoolean();

    boolean firstGen = !config.hasCategory(CAT_PATTERNS);

    categoryPatterns = config.getCategory(CAT_PATTERNS);
    categoryPatterns.setComment("Patterns are additional textures that can be overlaid on top of large pots, both normal and colored.\n"
        + "For each pattern defined, a corresponding 'stamp' item is registered.  The stamp is used with the\n"
        + "pottery table to apply patterns to raw clay pots.\n\n"
        + "This mod can support up to 255 registered patterns.  To add a new pattern, create a new entry in the\n"
        + "config below using the form:\n\n"
        + "  S:pattern.#=texture_name; A Name\n\n"
        + "Where # is an id between 1 and 255 inclusive.\n"
        + "Place a corresponding texture_name.png file into the mod's jar file in assets/modularpots/textures/blocks.\n"
        + "To further control aspects of the pattern, seeing the next section, pattern_settings.\n\n"
        + "Note: Future versions of this mod may add new patterns.  If you haven't made any changes to this\n"
        + "configuration, simply delete it and let it regenerate.  Otherwise visit the mod's development thread\n"
        + "on Minecraft Forums to see what's changed.");

    categoryPatternSettings = config.getCategory(CAT_SETTINGS);
    categoryPatternSettings.setComment("Specifies all the attributes for patterns.  Attributes control how patterns can be found in the world.\n"
        + "In the future, they might control other aspects, such as how patterns are rendered.\n\n"
        + "By default, all patterns will take their attributes from the 'pattern_default' subcategory.  To\n"
        + "customize some or all attributes for a pattern, create a new subcategory modeled like this:\n\n"
        + "  pattern_# {\n"
        + "      I:weight=5\n"
        + "  }\n\n"
        + "The S:pattern_gen option controls what kinds of dungeon chests the pattern's stamp item will appear in, and the\n"
        + "rarity of the item appearing.  The location and rarity are separated by a comma (,), and multiple locations\n"
        + "are separated with a semicolon (;).  Rarity is a value between 1 and 100, with 1 being very rare.  Golden\n"
        + "apples and diamond horse armor also have a rarity of 1.  Most vanilla items have a rarity of 10.  The valid\n"
        + "location strings are:\n\n"
        + "  mineshaftCorridor, pyramidDesertChest, pyramidJungleChest, strongholdCorridor, strongholdLibrary,\n"
        + "  strongholdCrossing, villageBlacksmith, dungeonChest");

    populateDefaultPattern();

    if (firstGen) {
        config.get(categoryPatterns.getQualifiedName(), "pattern.1", "large_pot_1; Serpent");
        config.get(categoryPatterns.getQualifiedName(), "pattern.2", "large_pot_2; Lattice");
        config.get(categoryPatterns.getQualifiedName(), "pattern.3", "large_pot_3; Offset Squares");
        config.get(categoryPatterns.getQualifiedName(), "pattern.4", "large_pot_4; Inset");
        config.get(categoryPatterns.getQualifiedName(), "pattern.5", "large_pot_5; Turtle");
        config.get(categoryPatterns.getQualifiedName(), "pattern.6", "large_pot_6; Creeper");
        config.get(categoryPatterns.getQualifiedName(), "pattern.7", "large_pot_7; Freewheel");
        config.get(categoryPatterns.getQualifiedName(), "pattern.8", "large_pot_8; Creepy Castle");
        config.get(categoryPatterns.getQualifiedName(), "pattern.9", "large_pot_9; Savannah");
        config.get(categoryPatterns.getQualifiedName(), "pattern.10", "large_pot_10; Scales");
        config.get(categoryPatterns.getQualifiedName(), "pattern.11", "large_pot_11; Growth");
        config.get(categoryPatterns.getQualifiedName(), "pattern.12", "large_pot_12; Fern");
        config.get(categoryPatterns.getQualifiedName(), "pattern.13", "large_pot_13; Diamond");

        config.getCategory(CAT_SETTINGS + ".pattern_2");
        config.get(CAT_SETTINGS + ".pattern_2", "weight", 8);
    }

    config.save();

    for (int i = 1; i < 256; i++) {
        if (config.hasKey(categoryPatterns.getQualifiedName(), "pattern." + i)) {
            String entry = config.get(categoryPatterns.getQualifiedName(), "pattern." + i, "").getString();
            String[] parts = entry.split("[ ]*;[ ]*");

            String overlay = parts[0];
            String name = (parts.length > 1) ? parts[1] : null;

            patterns[i] = new PatternConfig(i, overlay, name);
            if (config.hasCategory(CAT_SETTINGS + ".pattern_" + i))
                parsePatternAttribs(patterns[i], CAT_SETTINGS + ".pattern_" + i);
            else {
                if (patterns[i].getName() == null)
                    patterns[i].setName(defaultPattern.getName());

                patterns[i].setWeight(defaultPattern.getWeight());
            }

            patternCount++;
        }
    }
}