SSCL Wiki

Config Category

A ConfigCategory contains the values belonging to a category.

Categories are created with:

ConfigCategory GENERAL = CONFIG.category("general");

Category Comment

GENERAL.comment("General mod settings.");

Value Factories

Boolean

GENERAL.bool("enabled", true);

Integer

GENERAL.intValue("distance", 8);

Double

GENERAL.doubleValue("scale", 1.0);

String

GENERAL.string("name", "Steve");

Enum

GENERAL.enumValue(
		"mode",
		Mode.class,
		Mode.NORMAL
);

Boolean List

GENERAL.boolList(
		"features",
		List.of(true, false)
);

Integer List

GENERAL.intList(
		"dimensions",
		List.of(1, 2, 3)
);

Double List

GENERAL.doubleList(
		"scales",
		List.of(0.5, 1.0, 2.0)
);

String List

GENERAL.stringList(
		"names",
		List.of("Steve", "Alex")
);

Enum List

GENERAL.enumList(
		"modes",
		Mode.class,
		List.of(Mode.NORMAL, Mode.FAST)
);

id()

Returns the category ID.

String id = GENERAL.id();

comment()

Returns the category comment.

String comment = GENERAL.comment();

values()

Returns all values registered in the category.

Collection<ConfigValue<?, ?>> values = GENERAL.values();

Values are returned in registration order.