From aa6959c6a76668ab8e5028a548bdff6a05fb4cf1 Mon Sep 17 00:00:00 2001 From: pkstDev Date: Mon, 7 Nov 2022 18:30:28 +0800 Subject: [PATCH] Fix Mod Menu having an invalid config --- gradle.properties | 2 +- src/main/java/io/github/prospector/modmenu/ModMenu.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 89cb55de3..b142179f6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/main/java/io/github/prospector/modmenu/ModMenu.java b/src/main/java/io/github/prospector/modmenu/ModMenu.java index dfefe7e1c..0913b2b06 100644 --- a/src/main/java/io/github/prospector/modmenu/ModMenu.java +++ b/src/main/java/io/github/prospector/modmenu/ModMenu.java @@ -68,7 +68,11 @@ public void onInitializeClient() { ModMenuConfigManager.initializeConfig(); ImmutableMap.Builder> 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> map = new HashMap<>(); map.put(name, new AbstractMap.SimpleEntry<>(outlineColor, fillColor));