Interface ModConfig
@NonExtendable
public interface ModConfig
Settings of one mod:
<forge>/mods/<id>/config.toml, over the defaults in the mod's
jar (META-INF/zomboidforge/config.toml). A key missing from the file takes the
default. The table [forge] belongs to ZomboidForge and is not part of these settings.
Keys are snake_case; record components and paths use the same names converted
from camelCase (maxBalance reads max_balance), or the name of the
component's Key.
-
Method Summary
-
Method Details
-
bind
Creates a record from the settings. Supported component types:String,boolean,int,long,float,double(and their wrappers), enums (by constant name), records (TOML tables),List<T>,Map<String, T>(tables with free keys), andOptional<T>for values that may be missing. Every other component must have a value. Keys without a component are logged as warnings.MinandMaxbound numeric components.- Throws:
IllegalStateException- listing every missing, mistyped, or out-of-bounds valueIllegalArgumentException- whentypehas a component that configuration values cannot have, an invalid or repeatedKey, orMin/Maxon a component that is not numeric or with the minimum above the maximum
-
get
The value at a dotted path, e.g."features.max_balance", converted like a record component oftype. Primitive values use the wrapper types (Long.class).- Throws:
IllegalStateException- when the value exists but has another type
-