T
- the generic typepublic abstract class Setting<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
category |
protected java.lang.String[] |
comments |
protected T |
defaultValue |
protected java.lang.String |
key |
protected net.minecraftforge.common.config.Property |
property |
protected net.minecraftforge.common.config.Property.Type |
type |
protected T |
value |
Constructor and Description |
---|
Setting(java.lang.String key,
T defaultValue)
Instantiates a new setting.
|
Modifier and Type | Method and Description |
---|---|
T |
get()
Gets the value.
|
java.lang.String[] |
getComments()
Gets the comments.
|
abstract UIComponent |
getComponent(MalisisGui gui)
Gets the component.
|
abstract T |
getValueFromComponent()
Gets the value from component.
|
void |
load(net.minecraftforge.common.config.Configuration config)
Loads the configuration.
|
abstract T |
readValue(java.lang.String stringValue)
Reads the value.
|
void |
save()
Save the configuration.
|
void |
set(T value)
Sets the value.
|
void |
setCategory(java.lang.String category)
Sets the category.
|
void |
setComment(java.lang.String... comment)
Sets the comment.
|
abstract java.lang.String |
writeValue(T value)
Writes the value.
|
protected net.minecraftforge.common.config.Property property
protected net.minecraftforge.common.config.Property.Type type
protected java.lang.String category
protected java.lang.String key
protected java.lang.String[] comments
protected T defaultValue
protected T value
public Setting(java.lang.String key, T defaultValue)
key
- the keydefaultValue
- the default valuepublic void setCategory(java.lang.String category)
category
- the new categorypublic void setComment(java.lang.String... comment)
comment
- the new commentpublic void set(T value)
value
- the valuepublic T get()
public void load(net.minecraftforge.common.config.Configuration config)
config
- the configpublic void save()
public java.lang.String[] getComments()
public abstract T readValue(java.lang.String stringValue)
stringValue
- the string valuepublic abstract java.lang.String writeValue(T value)
value
- the valuepublic abstract UIComponent getComponent(MalisisGui gui)
gui
- the guipublic abstract T getValueFromComponent()