private static void sortPacks() { packPanels.clear(); packs.removeAll(); currentPacks.clear(); int counter = 0; selectedPack = 0; packInfo.setText(""); LaunchFrame.getInstance().modPacksPane.repaint(); if (origin.equalsIgnoreCase("all")) { for (ModPack pack : ModPack.getPackArray()) { if (type.equalsIgnoreCase("client")) { if (mcVersion.equalsIgnoreCase("all")) { addPack(pack); currentPacks.put(counter, pack); counter++; } else if (mcVersion.equalsIgnoreCase(pack.getMcVersion())) { addPack(pack); currentPacks.put(counter, pack); counter++; } } else if (type.equalsIgnoreCase("server")) { if (!pack.getServerUrl().isEmpty()) { if (mcVersion.equalsIgnoreCase("all")) { addPack(pack); currentPacks.put(counter, pack); counter++; } else if (mcVersion.equalsIgnoreCase(pack.getMcVersion())) { addPack(pack); currentPacks.put(counter, pack); counter++; } } } } } else if (origin.equalsIgnoreCase("ftb")) { for (ModPack pack : ModPack.getPackArray()) { if (pack.getAuthor().equalsIgnoreCase("the ftb team")) { if (type.equalsIgnoreCase("client")) { if (mcVersion.equalsIgnoreCase("all")) { addPack(pack); currentPacks.put(counter, pack); counter++; } else if (mcVersion.equalsIgnoreCase(pack.getMcVersion())) { addPack(pack); currentPacks.put(counter, pack); counter++; } } else if (type.equalsIgnoreCase("server")) { if (!pack.getServerUrl().isEmpty()) { if (mcVersion.equalsIgnoreCase("all")) { addPack(pack); currentPacks.put(counter, pack); counter++; } else if (mcVersion.equalsIgnoreCase(pack.getMcVersion())) { addPack(pack); currentPacks.put(counter, pack); counter++; } } } } } } else { for (ModPack pack : ModPack.getPackArray()) { if (!pack.getAuthor().equalsIgnoreCase("the ftb team")) { if (type.equalsIgnoreCase("client")) { if (mcVersion.equalsIgnoreCase("all")) { addPack(pack); currentPacks.put(counter, pack); counter++; } else if (mcVersion.equalsIgnoreCase(pack.getMcVersion())) { addPack(pack); currentPacks.put(counter, pack); counter++; } } else if (type.equalsIgnoreCase("server")) { if (!pack.getServerUrl().isEmpty()) { if (mcVersion.equalsIgnoreCase("all")) { addPack(pack); currentPacks.put(counter, pack); counter++; } else if (mcVersion.equalsIgnoreCase(pack.getMcVersion())) { addPack(pack); currentPacks.put(counter, pack); counter++; } } } } } } updatePacks(); }