package com.yolp900.itsjustacharm.client.guis;
import com.yolp900.itsjustacharm.api.IJCConstants;
import com.yolp900.itsjustacharm.config.ModConfig;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.fml.client.config.GuiConfig;
import net.minecraftforge.fml.client.config.IConfigElement;
import java.util.ArrayList;
import java.util.List;
public class ModConfigGui extends GuiConfig {
public ModConfigGui(GuiScreen guiScreen) {
super(guiScreen, getConfigCategories(), IJCConstants.MOD_ID, false, false, IJCConstants.MOD_NAME);
}
private static List<IConfigElement> getConfigCategories() {
List<IConfigElement> categories = new ArrayList<IConfigElement>();
for (String category : ModConfig.configuration.getCategoryNames()) {
ConfigCategory cc = ModConfig.configuration.getCategory(category);
if (cc.isChild()) continue;
ConfigElement ce = new ConfigElement(cc);
categories.add(ce);
}
return categories;
}
}