-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #334 from AzureAaron/yacl3
Config Tweaks
- Loading branch information
Showing
14 changed files
with
268 additions
and
117 deletions.
There are no files selected for viewing
18 changes: 14 additions & 4 deletions
18
src/main/java/me/xmrvizzy/skyblocker/config/ConfigUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
package me.xmrvizzy.skyblocker.config; | ||
|
||
import dev.isxander.yacl3.api.Option; | ||
import dev.isxander.yacl3.api.controller.BooleanControllerBuilder; | ||
import dev.isxander.yacl3.api.controller.EnumControllerBuilder; | ||
import me.xmrvizzy.skyblocker.config.controllers.EnumDropdownControllerBuilder; | ||
|
||
public class ConfigUtils { | ||
@SuppressWarnings("unchecked") | ||
public static <E extends Enum<E>> EnumControllerBuilder<E> createEnumCyclingListController(Option<E> opt) { | ||
return EnumControllerBuilder.create(opt).enumClass((Class<E>) opt.binding().defaultValue().getClass()); | ||
} | ||
public static BooleanControllerBuilder createBooleanController(Option<Boolean> opt) { | ||
return BooleanControllerBuilder.create(opt).yesNoFormatter().coloured(true); | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
public static <E extends Enum<E>> EnumControllerBuilder<E> createEnumCyclingListController(Option<E> opt) { | ||
return EnumControllerBuilder.create(opt).enumClass((Class<E>) opt.binding().defaultValue().getClass()); | ||
} | ||
|
||
public static <E extends Enum<E>> EnumDropdownControllerBuilder<E> createEnumDropdownController(Option<E> opt) { | ||
return EnumDropdownControllerBuilder.create(opt); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 30 additions & 31 deletions
61
src/main/java/me/xmrvizzy/skyblocker/config/categories/DungeonsCategory.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.