public final class ConfigProperty
extends java.lang.Object
ConfigHandler for configuring the settings of the IConfigurable.
Do no confuse with ConfigurableProperty which is an annotation an is internally used to
make new instances of ConfigProperty.| Constructor and Description |
|---|
ConfigProperty(java.lang.String category,
java.lang.String name,
java.lang.Object value,
ConfigPropertyCallback callback,
boolean isCommandable,
java.lang.reflect.Field field)
Define a new configurable property without a comment.
|
ConfigProperty(java.lang.String category,
java.lang.String name,
java.lang.Object value,
java.lang.String comment,
ConfigPropertyCallback callback,
boolean isCommandable,
java.lang.reflect.Field field)
Define a new configurable property.
|
| Modifier and Type | Method and Description |
|---|---|
ConfigPropertyCallback |
getCallback()
Get the callback.
|
java.lang.String |
getCategory()
Get the category.
|
java.lang.String |
getComment()
Get the comment.
|
java.lang.String |
getName()
Get the name.
|
java.lang.Object |
getValue()
Get the value.
|
boolean |
isCommandable()
If this property can be configured with commands.
|
boolean |
isRequiresMcRestart() |
boolean |
isRequiresWorldRestart() |
void |
save(net.minecraftforge.common.config.Configuration config)
Save this property in the given config file.
|
void |
save(net.minecraftforge.common.config.Configuration config,
boolean forceUpdate)
Save this property in the given config file.
|
void |
setCallback(ConfigPropertyCallback callback)
Set the calback.
|
void |
setCategory(java.lang.String category)
Set the category.
|
void |
setCommandable(boolean isCommandable)
Set if this property can be configured with commands.
|
void |
setComment(java.lang.String comment)
Set the comment.
|
void |
setName(java.lang.String name)
Set the name.
|
void |
setRequiresMcRestart(boolean requiresMcRestart) |
void |
setRequiresWorldRestart(boolean requiresWorldRestart) |
void |
setValue(java.lang.Object value)
Set the value.
|
public ConfigProperty(java.lang.String category,
java.lang.String name,
java.lang.Object value,
java.lang.String comment,
ConfigPropertyCallback callback,
boolean isCommandable,
java.lang.reflect.Field field)
category - Category.name - Name of the property.value - Value of the property.comment - Comment of the property for in the config file.callback - Callback object for when this property is configured.isCommandable - If this property should be able to be changed at runtime via commands.field - The field of the ExtendedConfig this property refers to.public ConfigProperty(java.lang.String category,
java.lang.String name,
java.lang.Object value,
ConfigPropertyCallback callback,
boolean isCommandable,
java.lang.reflect.Field field)
category - Category.name - Name of the property.value - Value of the property.callback - Callback object for when this property is configured.isCommandable - If this property should be able to be changed at runtime via commands.field - The field of the ExtendedConfig this property refers to.public java.lang.String getCategory()
public void setCategory(java.lang.String category)
category - The category to set.public java.lang.String getName()
public void setName(java.lang.String name)
name - The name to be set.public java.lang.Object getValue()
public void setValue(java.lang.Object value)
value - The value to be set.public java.lang.String getComment()
public void setComment(java.lang.String comment)
comment - The comment to be set.public ConfigPropertyCallback getCallback()
public void setCallback(ConfigPropertyCallback callback)
callback - The callback to be set.public boolean isCommandable()
public void setCommandable(boolean isCommandable)
isCommandable - True if this property can be configured with commands.public void save(net.minecraftforge.common.config.Configuration config)
config - The config file to save to.public void save(net.minecraftforge.common.config.Configuration config,
boolean forceUpdate)
config - The config file to save to.forceUpdate - If the value in the config file has to be overwritten.public boolean isRequiresWorldRestart()
public void setRequiresWorldRestart(boolean requiresWorldRestart)
requiresWorldRestart - the requiresWorldRestart to setpublic boolean isRequiresMcRestart()
public void setRequiresMcRestart(boolean requiresMcRestart)
requiresMcRestart - the requiresMcRestart to set