Skip to content

Commit

Permalink
Fix Mod Menu having an invalid config
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamarine committed Nov 7, 2022
1 parent d27df21 commit aa6959c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G
# Also makes builds more reliable and less likely to randomly fail.
org.gradle.daemon=false

mod_version=1.8.6-bta.3
mod_version=1.8.6-bta.4
mod_group=io.github.prospector
mod_name=modmenu

Expand Down
6 changes: 5 additions & 1 deletion src/main/java/io/github/prospector/modmenu/ModMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ public void onInitializeClient() {
ModMenuConfigManager.initializeConfig();
ImmutableMap.Builder<String, Function<GuiScreen, ? extends GuiScreen>> factories = ImmutableMap.builder();
FabricLoader.getInstance().getEntrypoints("modmenu", ModMenuApi.class).forEach(api -> {
factories.put(api.getModId(), api.getConfigScreenFactory());
try {
api.getClass().getDeclaredMethod("getConfigScreenFactory"); // Make sure the method is implemented
factories.put(api.getModId(), api.getConfigScreenFactory());
} catch (NoSuchMethodException ignored) {
}
api.attachCustomBadges((name, outlineColor, fillColor) -> {
Map<String, Map.Entry<Integer, Integer>> map = new HashMap<>();
map.put(name, new AbstractMap.SimpleEntry<>(outlineColor, fillColor));
Expand Down

0 comments on commit aa6959c

Please sign in to comment.