// Path: src/main/java/com/creativemd/igcm/IGCMGuiManager.java
// public class IGCMGuiManager extends CustomGuiHandler {
// 	
// 	public static void openConfigGui(EntityPlayer player) {
// 		openConfigGui(player, "root");
// 	}
// 	
// 	public static void openConfigGui(EntityPlayer player, String path) {
// 		NBTTagCompound nbt = new NBTTagCompound();
// 		nbt.setInteger("gui", 0);
// 		nbt.setString("path", path);
// 		GuiHandler.openGui(IGCM.guiID, nbt, player);
// 	}
// 	
// 	public static void openProfileGui(EntityPlayer player) {
// 		NBTTagCompound nbt = new NBTTagCompound();
// 		nbt.setInteger("gui", 1);
// 		nbt.setInteger("index", 0);
// 		GuiHandler.openGui(IGCM.guiID, nbt, player);
// 	}
// 	
// 	@Override
// 	public SubContainer getContainer(EntityPlayer player, NBTTagCompound nbt) {
// 		int gui = nbt.getInteger("gui");
// 		String name = nbt.getString("path");
// 		switch (gui) {
// 		case 0:
// 			return new SubContainerConfigSegment(player, ConfigTab.getSegmentByPath(name));
// 		case 1:
// 			return new SubContainerProfile(player);
// 		case 2:
// 			return new SubContainerAdvancedWorkbench(player);
// 		}
// 		return null;
// 	}
// 	
// 	@Override
// 	@SideOnly(Side.CLIENT)
// 	public SubGui getGui(EntityPlayer player, NBTTagCompound nbt) {
// 		int gui = nbt.getInteger("gui");
// 		String name = nbt.getString("path");
// 		switch (gui) {
// 		case 0:
// 			return new SubGuiConfigSegement(ConfigTab.getSegmentByPath(name));
// 		case 1:
// 			return new SubGuiProfile();
// 		case 2:
// 			return new SubGuiAdvancedWorkbench();
// 		}
// 		return null;
// 	}
// 	
// }
// 
// Path: src/main/java/com/creativemd/igcm/utils/SearchUtils.java
// public class SearchUtils {
// 	
// 	public static boolean canStackBeFound(ItemStack stack, String search) {
// 		try {
// 			if (stack.getItem() instanceof ItemBlock)
// 				if (Block.REGISTRY.getNameForObject(Block.getBlockFromItem(stack.getItem())).toString().toLowerCase().contains(search))
// 					return true;
// 				else if (Item.REGISTRY.getNameForObject(stack.getItem()).toString().toLowerCase().contains(search))
// 					return true;
// 				
// 			return stack.getDisplayName().toLowerCase().contains(search);
// 		} catch (Exception e) {
// 			return false;
// 		}
// 	}
// 	
// 	public static boolean canInfoBeFound(InfoStack info, String search) {
// 		return info == null ? false : canStackBeFound(info.getItemStack(), search);
// 	}
// 	
// }


import java.util.ArrayList;
import com.creativemd.creativecore.client.avatar.AvatarItemStack;
import com.creativemd.creativecore.common.gui.ContainerControl;
import com.creativemd.creativecore.common.gui.GuiControl;
import com.creativemd.creativecore.common.gui.container.SubContainer;
import com.creativemd.creativecore.common.gui.container.SubGui;
import com.creativemd.creativecore.common.gui.controls.gui.GuiAvatarButton;
import com.creativemd.igcm.IGCMGuiManager;
import com.creativemd.igcm.utils.SearchUtils;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
package com.creativemd.igcm.api;




public abstract class ConfigGroupElement extends ConfigSegment {
	
	public ItemStack avatar;
	
	public ConfigGroupElement(String title, ItemStack avatar) {
		super(title);
		this.avatar = avatar;
	}
	
	public ArrayList<ContainerControl> createContainerControls(SubContainer container, int x, int y, int maxWidth) {
		return new ArrayList<>();
	}
	
	@SideOnly(Side.CLIENT)
	public ArrayList<GuiControl> createGuiControls(SubGui gui, int x, int y, int maxWidth) {
		ArrayList<GuiControl> controls = new ArrayList<>();
		controls.add(new GuiAvatarButton(getPath(), title, x + 5, y, 155, 16, new AvatarItemStack(avatar)) {
			@Override
			public void onClicked(int x, int y, int button) {
				IGCMGuiManager.openConfigGui(gui.getPlayer(), this.name);
			}
		});
		return controls;
	}
	
	@Override
	public boolean contains(String search) {
// Path: src/main/java/com/creativemd/igcm/IGCMGuiManager.java
// public class IGCMGuiManager extends CustomGuiHandler {
// 	
// 	public static void openConfigGui(EntityPlayer player) {
// 		openConfigGui(player, "root");
// 	}
// 	
// 	public static void openConfigGui(EntityPlayer player, String path) {
// 		NBTTagCompound nbt = new NBTTagCompound();
// 		nbt.setInteger("gui", 0);
// 		nbt.setString("path", path);
// 		GuiHandler.openGui(IGCM.guiID, nbt, player);
// 	}
// 	
// 	public static void openProfileGui(EntityPlayer player) {
// 		NBTTagCompound nbt = new NBTTagCompound();
// 		nbt.setInteger("gui", 1);
// 		nbt.setInteger("index", 0);
// 		GuiHandler.openGui(IGCM.guiID, nbt, player);
// 	}
// 	
// 	@Override
// 	public SubContainer getContainer(EntityPlayer player, NBTTagCompound nbt) {
// 		int gui = nbt.getInteger("gui");
// 		String name = nbt.getString("path");
// 		switch (gui) {
// 		case 0:
// 			return new SubContainerConfigSegment(player, ConfigTab.getSegmentByPath(name));
// 		case 1:
// 			return new SubContainerProfile(player);
// 		case 2:
// 			return new SubContainerAdvancedWorkbench(player);
// 		}
// 		return null;
// 	}
// 	
// 	@Override
// 	@SideOnly(Side.CLIENT)
// 	public SubGui getGui(EntityPlayer player, NBTTagCompound nbt) {
// 		int gui = nbt.getInteger("gui");
// 		String name = nbt.getString("path");
// 		switch (gui) {
// 		case 0:
// 			return new SubGuiConfigSegement(ConfigTab.getSegmentByPath(name));
// 		case 1:
// 			return new SubGuiProfile();
// 		case 2:
// 			return new SubGuiAdvancedWorkbench();
// 		}
// 		return null;
// 	}
// 	
// }
// 
// Path: src/main/java/com/creativemd/igcm/utils/SearchUtils.java
// public class SearchUtils {
// 	
// 	public static boolean canStackBeFound(ItemStack stack, String search) {
// 		try {
// 			if (stack.getItem() instanceof ItemBlock)
// 				if (Block.REGISTRY.getNameForObject(Block.getBlockFromItem(stack.getItem())).toString().toLowerCase().contains(search))
// 					return true;
// 				else if (Item.REGISTRY.getNameForObject(stack.getItem()).toString().toLowerCase().contains(search))
// 					return true;
// 				
// 			return stack.getDisplayName().toLowerCase().contains(search);
// 		} catch (Exception e) {
// 			return false;
// 		}
// 	}
// 	
// 	public static boolean canInfoBeFound(InfoStack info, String search) {
// 		return info == null ? false : canStackBeFound(info.getItemStack(), search);
// 	}
// 	
// }


// Path: src/main/java/com/creativemd/igcm/api/ConfigGroupElement.java
import java.util.ArrayList;
import com.creativemd.creativecore.client.avatar.AvatarItemStack;
import com.creativemd.creativecore.common.gui.ContainerControl;
import com.creativemd.creativecore.common.gui.GuiControl;
import com.creativemd.creativecore.common.gui.container.SubContainer;
import com.creativemd.creativecore.common.gui.container.SubGui;
import com.creativemd.creativecore.common.gui.controls.gui.GuiAvatarButton;
import com.creativemd.igcm.IGCMGuiManager;
import com.creativemd.igcm.utils.SearchUtils;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

package com.creativemd.igcm.api;




public abstract class ConfigGroupElement extends ConfigSegment {
	
	public ItemStack avatar;
	
	public ConfigGroupElement(String title, ItemStack avatar) {
		super(title);
		this.avatar = avatar;
	}
	
	public ArrayList<ContainerControl> createContainerControls(SubContainer container, int x, int y, int maxWidth) {
		return new ArrayList<>();
	}
	
	@SideOnly(Side.CLIENT)
	public ArrayList<GuiControl> createGuiControls(SubGui gui, int x, int y, int maxWidth) {
		ArrayList<GuiControl> controls = new ArrayList<>();
		controls.add(new GuiAvatarButton(getPath(), title, x + 5, y, 155, 16, new AvatarItemStack(avatar)) {
			@Override
			public void onClicked(int x, int y, int button) {
				IGCMGuiManager.openConfigGui(gui.getPlayer(), this.name);
			}
		});
		return controls;
	}
	
	@Override
	public boolean contains(String search) {
		return title.toLowerCase().contains(search) || key.toLowerCase().contains(search) || SearchUtils.canStackBeFound(avatar, search);