net.minecraftforge.common
Class Configuration

java.lang.Object
  extended by net.minecraftforge.common.Configuration

public class Configuration
extends Object

This class offers advanced configurations capabilities, allowing to provide various categories for configuration variables.


Field Summary
static String ALLOWED_CHARS
           
 TreeMap<String,Property> blockProperties
           
 Map<String,Map<String,Property>> categories
           
static String CATEGORY_BLOCK
           
static String CATEGORY_GENERAL
           
static String CATEGORY_ITEM
           
 TreeMap<String,Property> generalProperties
           
 TreeMap<String,Property> itemProperties
           
 
Constructor Summary
Configuration(File file)
          Create a configuration file for the file given in parameter.
 
Method Summary
 Property getOrCreateBlockIdProperty(String key, int defaultId)
          Gets or create a block id property.
 Property getOrCreateBooleanProperty(String key, String category, boolean defaultValue)
           
 Property getOrCreateIntProperty(String key, String category, int defaultValue)
           
 Property getOrCreateProperty(String key, String category, String defaultValue)
           
 void load()
           
 void save()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CATEGORY_GENERAL

public static final String CATEGORY_GENERAL
See Also:
Constant Field Values

CATEGORY_BLOCK

public static final String CATEGORY_BLOCK
See Also:
Constant Field Values

CATEGORY_ITEM

public static final String CATEGORY_ITEM
See Also:
Constant Field Values

categories

public Map<String,Map<String,Property>> categories

blockProperties

public TreeMap<String,Property> blockProperties

itemProperties

public TreeMap<String,Property> itemProperties

generalProperties

public TreeMap<String,Property> generalProperties

ALLOWED_CHARS

public static final String ALLOWED_CHARS
See Also:
Constant Field Values
Constructor Detail

Configuration

public Configuration(File file)
Create a configuration file for the file given in parameter.

Method Detail

getOrCreateBlockIdProperty

public Property getOrCreateBlockIdProperty(String key,
                                           int defaultId)
Gets or create a block id property. If the block id property key is already in the configuration, then it will be used. Otherwise, defaultId will be used, except if already taken, in which case this will try to determine a free default id.


getOrCreateIntProperty

public Property getOrCreateIntProperty(String key,
                                       String category,
                                       int defaultValue)

getOrCreateBooleanProperty

public Property getOrCreateBooleanProperty(String key,
                                           String category,
                                           boolean defaultValue)

getOrCreateProperty

public Property getOrCreateProperty(String key,
                                    String category,
                                    String defaultValue)

load

public void load()

save

public void save()