Heads up!
Added in Fzzy Config 0.6.5
Validation wrapping a Fzzy Config-specific TriState
(also found in Fabric API, Minecraft itself, among many other places). Like most Tri-states it has three values, TRUE
, FALSE
, and DEFAULT
.
Tri-states in Fzzy Config implement an interface TriStateProvider
that includes helper methods useful for getting and interacting with a tri-state. ValidatedTriState
also implements this interface and thus can be interacted with like it is a tri-state directly.
ValidatedField
and ValidatedCondition
now also include an overload of toCondition
/withCondition
that accepts a BooleanSupplier. TriStateProvider
, conveniently, is a BooleanSupplier thus can be passed directly to another validation as a condition. DEFAULT
will be treated as FALSE
in this case.
public ValidatedTriState myTriState = new ValidatedTriState(TriState.TRUE);public ValidatedTriState myTriState2 = new ValidatedTriState(TriState.TRUE, ValidatedTriState.WidgetType.CYCLING); //default widget has the three states side-by-side. A more classic MC cycling widget can also be used.public TriState mySimpleTriState = TriState.TRUE; //simple fields also work, validation will be wrapped automatically like most types.