public static void sortTexturePacks () {
        texturePackPanels.clear();
        texturePacks.removeAll();
        currentTexturePacks.clear();
        int counter = 0;
        selectedTexturePack = 0;
        texturePacks.repaint();
        HashMap<Integer, List<TexturePack>> sorted = Maps.newHashMap();
        sorted.put(0, new ArrayList<TexturePack>());
        sorted.put(1, new ArrayList<TexturePack>());
        for (TexturePack texturePack : TexturePack.getTexturePackArray()) {
            if (compatibilityCheck(texturePack) && resolutionCheck(texturePack) && textSearch(texturePack)) {
                if (texturePack.isCompatible(ModPack.getSelectedPack(true).getName())) {
                    sorted.get(1).add(texturePack);
                } else if (texturePack.isCompatible(ModPack.getSelectedPack(false).getName())) {
                    sorted.get(1).add(texturePack);
                } else {
                    sorted.get(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();
    }