public static void sortTexturePacks() {
		texturePackPanels.clear();
		texturePacks.removeAll();
		currentTexturePacks.clear();
		int counter = 0;
		selectedTexturePack = 0;
		texturePacks.repaint();
		HashMap<Integer, List<TexturePack>> sorted = new HashMap<Integer, List<TexturePack>>();			
		sorted.put(0, new ArrayList<TexturePack>());
		sorted.put(1, new ArrayList<TexturePack>());
		for(TexturePack texturePack : TexturePack.getTexturePackArray()) {
			if(compatibilityCheck(texturePack) && resolutionCheck(texturePack) && textSearch(texturePack)) {
				sorted.get((texturePack.isCompatible(ModPack.getSelectedPack().getDir())) ? 1 : 0).add(texturePack);
			}
		}
		for(TexturePack tp : sorted.get(1)) {
			addTexturePack(tp);
			currentTexturePacks.put(counter, tp);
			counter++;
		}
		for(TexturePack tp : sorted.get(0)) {
			addTexturePack(tp);
			currentTexturePacks.put(counter, tp);
			counter++;
		}
		updateTexturePacks();
	}