Package net.minecraftforge.common.config

Examples of net.minecraftforge.common.config.Property


    return r;
  }

  public int getNextOrderedValue(String name)
  {
    Property p = this.get( "orderedValues", name, 0 );
    int myValue = p.getInt();
    p.set( myValue + 1 );
    return myValue;
  }
View Full Code Here


    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

  }

  @Override
  public Property get(String category, String key, String defaultValue, String comment, Property.Type type)
  {
    Property prop = super.get( category, key, defaultValue, comment, type );

    if ( prop != null )
    {
      if ( !category.equals( "Client" ) )
        prop.setRequiresMcRestart( true );
    }

    return prop;
  }
View Full Code Here

    useLargeFonts = get( "Client", "useTerminalUseLargeFont", false ).getBoolean( false );

    // load buttons..
    for (int btnNum = 0; btnNum < 4; btnNum++)
    {
      Property cmb = get( "Client", "craftAmtButton" + (btnNum + 1), craftByStacks[btnNum] );
      Property pmb = get( "Client", "priorityAmtButton" + (btnNum + 1), priorityByStacks[btnNum] );
      Property lmb = get( "Client", "levelAmtButton" + (btnNum + 1), levelByStacks[btnNum] );

      int buttonCap = (int) (Math.pow( 10, btnNum + 1 ) - 1);

      craftByStacks[btnNum] = Math.abs( cmb.getInt( craftByStacks[btnNum] ) );
      priorityByStacks[btnNum] = Math.abs( pmb.getInt( priorityByStacks[btnNum] ) );
      levelByStacks[btnNum] = Math.abs( pmb.getInt( levelByStacks[btnNum] ) );

      cmb.comment = "Controls buttons on Crafting Screen : Capped at " + buttonCap;
      pmb.comment = "Controls buttons on Priority Screen : Capped at " + buttonCap;
      lmb.comment = "Controls buttons on Level Emitter Screen : Capped at " + buttonCap;

      craftByStacks[btnNum] = Math.min( craftByStacks[btnNum], buttonCap );
      priorityByStacks[btnNum] = Math.min( priorityByStacks[btnNum], buttonCap );
      levelByStacks[btnNum] = Math.min( levelByStacks[btnNum], buttonCap );
    }

    for (Enum e : settings.getSettings())
    {
      String Category = "Client"; // e.getClass().getSimpleName();
      Enum value = settings.getSetting( e );

      Property p = this.get( Category, e.name(), value.name(), getListComment( value ) );

      try
      {
        value = Enum.valueOf( value.getClass(), p.getString() );
      }
      catch (IllegalArgumentException er)
      {
        AELog.info( "Invalid value '" + p.getString() + "' for " + e.name() + " using '" + value.name() + "' instead" );
      }

      settings.putSetting( e, value );
    }
View Full Code Here

      return true;

    setCategoryComment(
        "OreCamouflage",
        "AE2 Automatically uses alternative ores present in your instance of MC to blend better with its surroundings, if you prefer you can disable this selectively using these flags; Its important to note, that some if these items even if enabled may not be craftable in game because other items are overriding their recipes." );
    Property p = get( "OreCamouflage", mt.name(), true );
    p.comment = "OreDictionary Names: " + mt.getOreName();

    return !p.getBoolean( true );
  }
View Full Code Here

    for (Enum e : settings.getSettings())
    {
      if ( e == setting )
      {
        String Category = "Client";
        Property p = this.get( Category, e.name(), settings.getSetting( e ).name(), getListComment( newValue ) );
        p.set( newValue.name() );
      }
    }

    if ( updatable )
      save();
View Full Code Here

  }

  public Enum getSetting(String Category, Class<? extends Enum> class1, Enum myDefault)
  {
    String name = class1.getSimpleName();
    Property p = get( Category, name, myDefault.name() );

    try
    {
      return (Enum) class1.getField( p.toString() ).get( class1 );
    }
    catch (Throwable t)
    {
      // :{
    }
View Full Code Here

        anchorCrafting = get(CAT_ANCHORS, "craftable", true, "change to {t}=false to disable World Anchor crafting, they will still be available via Creative");
        anchorCraftingPersonal = get(CAT_ANCHORS, "personal.craftable", true, "change to {t}=false to disable Personal Anchor crafting, they will still be available via Creative");
        printAnchors = get(CAT_ANCHORS, "print.locations", false, "change to {t}=true to print Anchor locations to the log on startup");
        printAnchorDebug = get(CAT_ANCHORS, "print.debug", false, "change to '{t}=true' to log debug info for Anchors");

        Property fuelProp = get(CAT_ANCHORS, "world.fuel", "minecraft:ender_pearl=12", "the number of hours that an item will power a World Anchor or World Anchor Cart\n"
                + "this is an approximation only, actual duration is affected by number of chunks loaded and tick rate\n"
                + "if the list is empty, World Anchors will not require fuel, default = 12\n"
                + "Entry Format: <modid>:<itemname>#<metadata>=<value>\n"
                + "Example: personal.fuel= minecraft:ender_pearl=12, minecraft:coal#0=4");
        anchorFuelWorldString = fuelProp.getString();

        fuelProp = get(CAT_ANCHORS, "personal.fuel", "minecraft:ender_pearl=12", "the number of hours that an item will power a Personal Anchor or Personal Anchor Cart\n"
                + "this is an approximation only, actual duration is affected by number of chunks loaded and tick rate\n"
                + "if the list is empty, World Anchors will not require fuel, default = 12\n"
                + "Entry Format: <modid>:<itemname>#<metadata>=<value>\n"
                + "Example: personal.fuel= minecraft:ender_pearl=12, minecraft:coal#0=4");
        anchorFuelPersonalString = fuelProp.getString();

        anchorsCanInteractWithPipes = get(CAT_ANCHORS, "interact.with.pipes", true, "change to {t}=false to prevent pipes, tubes, or various other things from interacting with Anchors");       
    }
View Full Code Here

                loadBlockFeature(type.getTag());
        }
    }

    private static void loadBlockProperty(String tag) {
        Property prop = configBlock.get(CAT_BLOCKS, tag, true);
        enabledBlocks.put(tag, prop.getBoolean(true));
    }
View Full Code Here

        enabledBlocks.put(tag, prop.getBoolean(true));
    }

    private static void loadBlockFeature(String tag) {
        tag = MiscTools.cleanTag(tag);
        Property prop = configBlock.get(CAT_SUBBLOCKS, tag, true);
        enabledSubBlocks.put(tag, prop.getBoolean(true));
    }
View Full Code Here

TOP

Related Classes of net.minecraftforge.common.config.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.