|
5 | 5 | import net.minecraft.client.gui.screens.Screen; |
6 | 6 | import net.minecraft.network.chat.Component; |
7 | 7 | import net.minecraft.util.Util; |
8 | | -import pl.skidam.automodpack_core.Constants; |
9 | 8 | import pl.skidam.automodpack_loader_core.client.ModpackUpdater; |
10 | 9 | import pl.skidam.automodpack_core.config.Jsons; |
11 | 10 | import pl.skidam.automodpack_core.modpack.ClientSelectionManager; |
@@ -209,29 +208,29 @@ private void install() { |
209 | 208 | mgr.addPack(content.modpackName, new Jsons.ClientSelectionManagerFields.Modpack(new Jsons.ModpackAddresses())); |
210 | 209 | } |
211 | 210 |
|
212 | | - Constants.LOGGER.info("Selected {} pack", content.modpackName); |
213 | | - Constants.LOGGER.info("Selected {} groups", selectedGroups); |
214 | | - |
215 | | - mgr.setSelectedPack(content.modpackName); |
216 | | - |
217 | 211 | // Assemble Groups map |
218 | 212 | List<Jsons.ClientSelectionManagerFields.Group> finalGroupsToSave = new ArrayList<>(); |
219 | 213 | for (String id : selectedGroups) { |
220 | 214 | List<String> filesForGroup = new ArrayList<>(); |
221 | 215 | Jsons.ModpackGroupFields group = content.groups.get(id); |
222 | | - // add all groups even if the group is not selective because it might become one someday, so yeah save all files which we download currently |
223 | | - if (group != null && selectedSelectiveFiles.containsKey(id)) { |
224 | | - filesForGroup.addAll(selectedSelectiveFiles.get(id)); |
| 216 | + // add all groups even if the group is not selective because it might become one someday, so save all files which we download currently |
| 217 | + if (group != null) { |
| 218 | + if (group.selective && selectedSelectiveFiles.containsKey(id)) { |
| 219 | + filesForGroup.addAll(selectedSelectiveFiles.get(id)); |
| 220 | + } else if (!group.selective) { |
| 221 | + filesForGroup.addAll(group.files.stream().map(modpackContentItem -> modpackContentItem.file).toList()); |
| 222 | + } |
225 | 223 | } |
226 | 224 | finalGroupsToSave.add(new Jsons.ClientSelectionManagerFields.Group(id, filesForGroup)); |
227 | 225 | } |
228 | 226 |
|
229 | 227 | mgr.setSelectedGroups(content.modpackName, finalGroupsToSave); |
| 228 | + mgr.setSelectedPack(content.modpackName); |
230 | 229 |
|
231 | 230 | Set<Jsons.ModpackContentItem> finalFiles = new HashSet<>(); |
232 | 231 | for (String id : selectedGroups) { |
233 | 232 | Jsons.ModpackGroupFields group = content.groups.get(id); |
234 | | - if (group == null || !isOsCompatible(group.compatibleOS) || group.files == null) continue; |
| 233 | + if (group == null || group.files == null) continue; |
235 | 234 |
|
236 | 235 | if (group.selective) { |
237 | 236 | Set<String> selectedFiles = selectedSelectiveFiles.get(id); |
|
0 commit comments