A Basic Example
A small config can look like this:
public final class ExampleModConfig {
public static final Config CONFIG = SSCL.create(
ExampleMod.MOD_ID,
"ExampleMod/config.toml",
ConfigSide.CLIENT
);
public static final ConfigCategory GENERAL = CONFIG
.category("general")
.comment("General mod settings.");
public static final BooleanValue ENABLED = GENERAL
.bool("enabled", true)
.comment("Whether the mod is enabled.")
.tooltip("Turns the mod on or off.");
public static final IntValue DISTANCE = GENERAL
.intValue("distance", 8)
.min(1)
.max(32)
.comment("Maximum distance in blocks.")
.tooltip("Controls how far the mod can reach.");
public static final DoubleValue SCALE = GENERAL
.doubleValue("scale", 1.0)
.min(0.5)
.max(2.0)
.decimals(2)
.comment("Display scale.")
.tooltip("Controls the size of the interface.");
public static final StringValue LABEL = GENERAL
.string("label", "Example")
.comment("Text used by the mod.");
private ExampleModConfig() {
}
}
That's basically the SSCL API. Easy to define, easy to read and easy for users to understand without adding a bunch of stuff that most mods don't need.