Package net.minecraftforge.common

Examples of net.minecraftforge.common.Property


            cfg.load();
        } catch (Exception e) {
            FMLLog.log(Level.SEVERE, e, "UsefullThings config error");
        }

        Property firstblockId = cfg.getOrCreateBlockIdProperty("cobblegen.id", 200);
        Property luminolampId = cfg.getOrCreateBlockIdProperty("luminolamp.id", 201);
        Property engineId = cfg.getOrCreateBlockIdProperty("engine.id", 202);
        firstblockId.comment = "Block Id of cogglegen machines";
        luminolampId.comment = "Block Id of luminescence lighting";
        engineId.comment = "Block Id of Engine blocks";
        usefullthingsblockId = firstblockId.getInt(200);
        luminolampBlockId = luminolampId.getInt(201);
        usefullengineBlockId = engineId.getInt(202);
       
        cfg.save();
    }
View Full Code Here


    pad = getIndent(indent + 1);

    Property[] props = properties.values().toArray(new Property[properties.size()]);

    for (int x = 0; x < props.length; x++) {
      Property prop = props[x];

      if (prop.comment != null) {
        if (x != 0) {
          out.newLine();
        }

        for (String commentLine : splitter.split(prop.comment)) {
          out.write(pad);
          out.write("# ");
          out.write(commentLine);
          out.newLine();
        }
      }

      String propName = prop.getName();
      propName = !allowedProperties.matchesAllOf(propName) ? '"' + propName + '"' : propName;

      if (prop.isList()) {
        out.write(pad);
        out.write(prop.getType().getID());
        out.write(':');
        out.write(propName);
        out.write(" <");
        out.newLine();
        pad = getIndent(indent + 2);

        for (String line : prop.getStringList()) {
          out.write(pad);
          out.write(line);
          out.newLine();
        }

        out.write(getIndent(indent + 1));
        out.write(" >");
        out.newLine();
        pad = getIndent(indent + 1);
      } else if (prop.getType() == null) {
        out.write(pad);
        out.write(propName);
        out.write('=');
        out.write(prop.getString());
      } else {
        out.write(pad);
        out.write(prop.getType().getID());
        out.write(':');
        out.write(propName);
        out.write('=');
        out.write(prop.getString());
        out.newLine();
      }
    }

    for (ConfigCategory child : children) {
View Full Code Here

TOP

Related Classes of net.minecraftforge.common.Property

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.