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

The following examples show how to use net.minecraftforge.common.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: HexxitGearConfig.java    From HexxitGear with GNU General Public License v3.0 5 votes vote down vote up
public static void loadCommonConfig(FMLPreInitializationEvent evt)
{
    Configuration c = new Configuration(evt.getSuggestedConfigurationFile());
    try {
        c.load();

        hexbiscus = c.getBlock("ID.HexbiscusFlower", 2400);

        tribalHelmetId = c.getItem(Configuration.CATEGORY_ITEM, "ID.TribalHelmet", 26200);
        tribalChestId = c.getItem(Configuration.CATEGORY_ITEM, "ID.TribalChest", 26201);
        tribalLeggingsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.TribalLeggings", 26202);
        tribalShoesId = c.getItem(Configuration.CATEGORY_ITEM, "ID.TribalShoes", 26203);

        scaleHelmetId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ScaleHelmet", 26204);
        scaleChestId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ScaleChest", 26205);
        scaleLeggingsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ScaleLeggings", 26206);
        scaleBootsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ScaleBoots", 26207);

        thiefHelmetId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThiefHelmet", 26208);
        thiefChestId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThiefChest", 26209);
        thiefLeggingsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThiefLeggings", 26210);
        thiefBootsId = c.getItem(Configuration.CATEGORY_ITEM, "ID.ThiefBoots", 26211);

        hexicalEssence = c.getItem(Configuration.CATEGORY_ITEM, "ID.HexicalEssence", 26212);
        hexicalDiamond = c.getItem(Configuration.CATEGORY_ITEM, "ID.HexicalDiamond", 26213);

        dimensionalBlacklist = c.get("World Generation", "Dimensional Blacklist", "");
        dimensionalBlacklist.comment = "Comma separated list of all blacklisted dimension IDs";

    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        c.save();
    }
}