Package org.cyclops.cyclopscore.config
Class ConfigurablePropertyData<T>
java.lang.Object
org.cyclops.cyclopscore.config.ConfigurablePropertyData<T>
- Type Parameters:
T
- The property value.
A holder class for properties that go inside the config file.
Used inside the
ConfigHandler
for configuring the settings of the configurable.
Do no confuse with ConfigurableProperty
which is an annotation an is internally used to
make new instances of ConfigurablePropertyData
.-
Constructor Summary
ConstructorDescriptionConfigurablePropertyData
(ModBase mod, String category, String name, T defaultValue, String comment, boolean isCommandable, net.minecraftforge.fml.config.ModConfig.Type configLocation, Field field, boolean requiresWorldRestart, boolean requiresMcRestart, boolean showInGui, int minValue, int maxValue) Define a new configurable property. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraftforge.fml.config.ModConfig.Type
net.minecraftforge.common.ForgeConfigSpec.ConfigValue<T>
getName()
boolean
void
onConfigInit
(net.minecraftforge.common.ForgeConfigSpec.Builder configBuilder) void
-
Constructor Details
-
ConfigurablePropertyData
public ConfigurablePropertyData(ModBase mod, String category, String name, T defaultValue, String comment, boolean isCommandable, net.minecraftforge.fml.config.ModConfig.Type configLocation, Field field, boolean requiresWorldRestart, boolean requiresMcRestart, boolean showInGui, int minValue, int maxValue) Define a new configurable property.- Parameters:
mod
- The owner mod.category
- Category.name
- Name of the property.defaultValue
- Value of the property.comment
- Comment of the property for in the config file.isCommandable
- If this property should be able to be changed at runtime via commands.configLocation
- The config location.field
- The field of theExtendedConfig
this property refers to.requiresWorldRestart
- If this property requires a world restart after change.requiresMcRestart
- If this property requires a minecraft restart after change.showInGui
- If this property should be editable via the gui.minValue
- The minimal int value.maxValue
- The maximal int value.
-
-
Method Details
-
onConfigInit
public void onConfigInit(net.minecraftforge.common.ForgeConfigSpec.Builder configBuilder) -
getConfigProperty
-
isCommandable
public boolean isCommandable()- Returns:
- Can this property be changed through commands.
-
getCategory
-
getName
-
getConfigLocation
public net.minecraftforge.fml.config.ModConfig.Type getConfigLocation() -
getLanguageKey
- Returns:
- the LanguageKey
-
saveToField
public void saveToField()
-