Class ConfigBuilder
java.lang.Object
se.itssimple.obsidianweave.data.ConfigBuilder
Builder for mod configuration entries in Obsidian Weave.
Used to define and collect config entries for a specific mod.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigBuilder(String modId) Constructs a config builder for the given mod ID. -
Method Summary
Modifier and TypeMethodDescription<T> ConfigEntry<T> add(ConfigEntry<T> entry) Adds a config entry to the builder.Defines a boolean config entry with auto-generated language keys.Defines a boolean config entry with custom language keys.Defines a double config entry with auto-generated language keys.Defines a double config entry with custom language keys.Defines an integer config entry with auto-generated language keys.Defines an integer config entry with custom language keys.Defines a string config entry with auto-generated language keys.Defines a string config entry with custom language keys.List<ConfigEntry<?>> Gets all config entries added to the builder.
-
Constructor Details
-
ConfigBuilder
Constructs a config builder for the given mod ID.- Parameters:
modId- The mod ID.
-
-
Method Details
-
add
Adds a config entry to the builder.- Type Parameters:
T- The entry type.- Parameters:
entry- The config entry to add.- Returns:
- The added config entry.
-
getEntries
Gets all config entries added to the builder.- Returns:
- List of config entries.
-
define
public ConfigEntry<Boolean> define(String key, boolean defaultValue, String nameLangKey, String commentLangKey) Defines a boolean config entry with custom language keys.- Parameters:
key- The config key.defaultValue- The default value.nameLangKey- The language key for the name.commentLangKey- The language key for the comment.- Returns:
- The defined config entry.
-
define
Defines a boolean config entry with auto-generated language keys.- Parameters:
key- The config key.defaultValue- The default value.- Returns:
- The defined config entry.
-
define
public ConfigEntry<String> define(String key, String defaultValue, String nameLangKey, String commentLangKey) Defines a string config entry with custom language keys.- Parameters:
key- The config key.defaultValue- The default value.nameLangKey- The language key for the name.commentLangKey- The language key for the comment.- Returns:
- The defined config entry.
-
define
Defines a string config entry with auto-generated language keys.- Parameters:
key- The config key.defaultValue- The default value.- Returns:
- The defined config entry.
-
define
public ConfigEntry<Integer> define(String key, Integer defaultValue, String nameLangKey, String commentLangKey) Defines an integer config entry with custom language keys.- Parameters:
key- The config key.defaultValue- The default value.nameLangKey- The language key for the name.commentLangKey- The language key for the comment.- Returns:
- The defined config entry.
-
define
Defines an integer config entry with auto-generated language keys.- Parameters:
key- The config key.defaultValue- The default value.- Returns:
- The defined config entry.
-
define
public ConfigEntry<Double> define(String key, Double defaultValue, String nameLangKey, String commentLangKey) Defines a double config entry with custom language keys.- Parameters:
key- The config key.defaultValue- The default value.nameLangKey- The language key for the name.commentLangKey- The language key for the comment.- Returns:
- The defined config entry.
-
define
Defines a double config entry with auto-generated language keys.- Parameters:
key- The config key.defaultValue- The default value.- Returns:
- The defined config entry.
-