Skip to content

ConfigCycle

kr1viah_ edited this page Jan 13, 2026 · 2 revisions

ConfigCycle

ConfigCycle is a class that makes enum/cycle configs easier. There are 2 types.

Use .getValue() or .setValue(T value) to get or set the value

EnumBackedCycleConfig

Use this if you have an enum class that you want to make an option.

For example:

public static final ConfigCycle<SomeEnum> CYCLE_CONFIG = new EnumBackedCycleConfig.Builder<>("Cycle Config", SomeEnum.class)
		.displayNameProvider(someEnum -> someEnum.name().toLowerCase(Locale.ROOT))
		.build();

public static enum SomeEnum {
	OPTION_ONE,
	OPTION_TWO,
}

This would create a new cycle config with the name Cycle Config, with the enum SomeEnum.class, and with a display name provider.

ArrayBackedCycleConfig

Use this if you have multiple values you don't want to create an enum for.

public static final ConfigCycle<String> CYCLE_CONFIG = new ArrayBackedCycleConfig.Builder<String>("Cycle config", "String One", "String Two").build();

This would create a new cycle config with the name Cycle Config, with the options "String One" and "String Two". (Note: works with any class, not just primitives and strings)

Clone this wiki locally