Files
StructureLib/src/main/java/com/gtnewhorizon/structurelib/GuiModConfig.java
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
1.1 KiB
Java
Raw Normal View History

package com.gtnewhorizon.structurelib;
2022-08-08 17:40:12 +08:00
import java.util.List;
import java.util.stream.Collectors;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.common.config.Configuration;
import cpw.mods.fml.client.config.GuiConfig;
import cpw.mods.fml.client.config.IConfigElement;
public class GuiModConfig extends GuiConfig {
public GuiModConfig(GuiScreen guiScreen) {
2022-08-08 17:40:12 +08:00
super(
guiScreen,
getConfigElements(),
StructureLibAPI.MOD_ID,
false,
false,
GuiConfig.getAbridgedConfigPath(ConfigurationHandler.INSTANCE.getConfig().toString()));
}
@SuppressWarnings("rawtypes")
private static List<IConfigElement> getConfigElements() {
final Configuration config = ConfigurationHandler.INSTANCE.getConfig();
return config.getCategoryNames().stream().filter(name -> name.indexOf('.') == -1)
2022-08-08 17:40:12 +08:00
.map(name -> new ConfigElement(config.getCategory(name))).collect(Collectors.toList());
}
}