-
-
Notifications
You must be signed in to change notification settings - Fork 63
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 #328 from AzureAaron/yacl3
YACL Config
- Loading branch information
Showing
92 changed files
with
3,053 additions
and
994 deletions.
There are no files selected for viewing
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
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
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
5 changes: 2 additions & 3 deletions
5
src/main/java/me/xmrvizzy/skyblocker/compatibility/modmenu/ModMenuEntry.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,16 +1,15 @@ | ||
package me.xmrvizzy.skyblocker.compatibility.modmenu; | ||
|
||
import me.shedaniel.autoconfig.AutoConfig; | ||
import com.terraformersmc.modmenu.api.ConfigScreenFactory; | ||
import com.terraformersmc.modmenu.api.ModMenuApi; | ||
import me.xmrvizzy.skyblocker.config.SkyblockerConfig; | ||
import me.xmrvizzy.skyblocker.config.SkyblockerConfigManager; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
|
||
@Environment(EnvType.CLIENT) | ||
public class ModMenuEntry implements ModMenuApi { | ||
@Override | ||
public ConfigScreenFactory<?> getModConfigScreenFactory() { | ||
return screen -> AutoConfig.getConfigScreen(SkyblockerConfig.class, screen).get(); | ||
return SkyblockerConfigManager::createGUI; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package me.xmrvizzy.skyblocker.config; | ||
|
||
import dev.isxander.yacl3.api.Option; | ||
import dev.isxander.yacl3.api.controller.EnumControllerBuilder; | ||
|
||
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()); | ||
} | ||
} |
Oops, something went wrong.