Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Commit 86dd127

Browse files
committed
Fixed a problem with ModMenu registration #2
1 parent 191499e commit 86dd127

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/client/java/ir/mehradn/mehradconfig/entrypoint/ModMenuEntrypoint.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ public class ModMenuEntrypoint implements ModMenuApi {
1717
@Override
1818
public Map<String, ConfigScreenFactory<?>> getProvidedConfigScreenFactories() {
1919
Map<String, ConfigScreenFactory<?>> factories = new HashMap<>();
20-
for (Map.Entry<String, Supplier<MehradConfig>> entry : ModMenuConfig.modMenuConfigs.entrySet()) {
21-
String modId = entry.getKey();
22-
Supplier<MehradConfig> configConstructor = entry.getValue();
23-
ConfigScreenBuilder configScreenBuilder = ModMenuConfigScreen.modMenuScreenBuilders.getOrDefault(modId, DEFAULT);
24-
factories.put(entry.getKey(), (parent) -> configScreenBuilder.buildAndLoad(configConstructor, parent));
20+
for (String modId : ModMenuConfig.modMenuConfigs.keySet()) {
21+
factories.put(modId, (parent) -> {
22+
Supplier<MehradConfig> configConstructor = ModMenuConfig.modMenuConfigs.get(modId);
23+
ConfigScreenBuilder configScreenBuilder = ModMenuConfigScreen.modMenuScreenBuilders.getOrDefault(modId, DEFAULT);
24+
return configScreenBuilder.buildAndLoad(configConstructor, parent);
25+
});
2526
}
2627
return factories;
2728
}

0 commit comments

Comments
 (0)