Package net.minecraftforge.common.config

Examples of net.minecraftforge.common.config.ConfigCategory


    public static boolean cropsAllowBonemeal = true;

    public static void loadConfig(File configFile) {
        config = new Configuration(configFile);

        new ConfigCategory(CATEGORY_POTIONS);
        new ConfigCategory(CATEGORY_ENCHANTMENTS);
        new ConfigCategory(CATEGORY_KAMI_ITEMS);
        new ConfigCategory(CATEGORY_KAMI_BLOCKS);
        new ConfigCategory(CATEGORY_KAMI_GENERAL);

        String comment = "These will only be used if KAMI is loaded. (KAMI is a separate download you can find in the Thaumic Tinkerer thread)";
        config.addCustomCategoryComment(CATEGORY_KAMI_ITEMS, comment);
        config.addCustomCategoryComment(CATEGORY_KAMI_BLOCKS, comment);
        config.addCustomCategoryComment(CATEGORY_KAMI_GENERAL, comment);
View Full Code Here


                data.putField(name, value);
            }

            for (String childName : cfg.getCategoryNames())
            {
                ConfigCategory child = cfg.getCategory(childName);
                if (child.isChild() && child.parent == cat) // intentional use of ==
                {
                    name = child.getQualifiedName().replace(cat.getQualifiedName() + ".", "");
                    newInfo = info.getInfoForField(name);
                    if (newInfo == null)
                        continue;
                    newData = DataStorageManager.getDataForType(newInfo.getType());
                    if (newData == null)
View Full Code Here

                    ForgeChunkManager.addConfigProperty(modObject, "maximumChunksPerTicket", String.valueOf(maxChunks), Property.Type.INTEGER);
                   
                    if (this.owningScreen.parentScreen instanceof GuiConfig)
                    {
                        GuiConfig superParent = (GuiConfig) this.owningScreen.parentScreen;
                        ConfigCategory modCtgy = ForgeChunkManager.getConfigFor(modObject);
                        modCtgy.setPropertyOrder(ForgeChunkManager.MOD_PROP_ORDER);
                        ConfigElement modConfig = new ConfigElement(modCtgy);
                       
                        boolean found = false;
                        for (IConfigElement ice : superParent.configElements)
                            if (ice.getName().equals(currentValue))
View Full Code Here

    public static void addConfigProperty(Object mod, String propertyName, String value, Property.Type type)
    {
        ModContainer container = getContainer(mod);
        if (container != null)
        {
            ConfigCategory cat = config.getCategory(container.getModId());
            Property prop = new Property(propertyName, value, type).setLanguageKey("forge.configgui." + propertyName);
            if (type == Property.Type.INTEGER)
            {
                prop.setMinValue(0);
            }
            cat.put(propertyName, prop);
        }
    }
View Full Code Here

    return myValue;
  }

  public int getPlayerID(GameProfile profile)
  {
    ConfigCategory playerList = this.getCategory( "players" );

    if ( playerList == null || profile == null || !profile.isComplete() )
      return -1;

    String uuid = profile.getId().toString();

    Property prop = playerList.get( uuid );
    if ( prop != null && prop.isIntValue() )
      return prop.getInt();
    else
    {
      playerList.put( uuid, prop = new Property( uuid, "" + nextPlayer(), Property.Type.INTEGER ) );
      getUUIDMap().put( prop.getInt(), profile.getId() ); // add to reverse map
      save();
      return prop.getInt();
    }
  }
View Full Code Here

  {
    if ( idToUUID == null )
    {
      idToUUID = new HashMap<Integer, UUID>();

      ConfigCategory playerList = this.getCategory( "players" );

      for (Entry<String, Property> b : playerList.getValues().entrySet())
        idToUUID.put( b.getValue().getInt(), UUID.fromString( b.getKey() ) );
    }

    return idToUUID;
  }
View Full Code Here

        continue;

      if ( cat.equals( "settings" ) )
        continue;

      ConfigCategory cc = AEConfig.instance.getCategory( cat );

      if ( cc.isChild() )
        continue;

      ConfigElement ce = new ConfigElement( cc );
      list.add( ce );
    }
View Full Code Here

    }

    private static void loadRecipeOption() {
        configMain.addCustomCategoryComment(CAT_RECIPES, "You can add or remove various recipes here");

        ConfigCategory cat = configMain.getCategory(CAT_RECIPES);
        Iterator<String> keys = cat.keySet().iterator();
        while (keys.hasNext()) {
            String key = keys.next();
            if (key.startsWith("recipe"))
                keys.remove();
        }
View Full Code Here

TOP

Related Classes of net.minecraftforge.common.config.ConfigCategory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.