Files
CraterLib/1.21/Fabric/src/main/java/com/hypherionmc/craterlib/CraterLibModMenuIntegration.java

30 lines
1018 B
Java
Raw Normal View History

2024-06-13 19:07:34 +02:00
package com.hypherionmc.craterlib;
import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
import com.hypherionmc.craterlib.core.config.ConfigController;
import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
import java.util.HashMap;
import java.util.Map;
/**
* @author HypherionSA
*/
public class CraterLibModMenuIntegration implements ModMenuApi {
@Override
public Map<String, ConfigScreenFactory<?>> getProvidedConfigScreenFactories() {
Map<String, ConfigScreenFactory<?>> configScreens = new HashMap<>();
ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
2024-06-13 19:07:34 +02:00
if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
configScreens.put(watcher.getLeft().getModId(), screen -> new CraterConfigScreen(watcher.getLeft(), screen));
2024-06-13 19:07:34 +02:00
}
});
return configScreens;
}
}