package me.xmrvizzy.skyblocker.config; import dev.isxander.yacl3.api.Option; import dev.isxander.yacl3.api.controller.CyclingListControllerBuilder; import net.minecraft.text.Text; public class ConfigUtils { @SuppressWarnings("unchecked") public static > CyclingListControllerBuilder createCyclingListController4Enum(Option opt) { E[] constants = (E[]) opt.binding().defaultValue().getClass().getEnumConstants(); return CyclingListControllerBuilder.create(opt).values(constants).formatValue(formatter -> Text.of(formatter.toString())); } }