private void checkPastForgeVersion() { if (new File(".").getAbsolutePath().contains("MultiMC")) { JSONObject currentJson; JSONObject multiMCJson; try { currentJson = (JSONObject) new JSONParser().parse(new FileReader(arguments.getManifests().get(0))); multiMCJson = (JSONObject) new JSONParser().parse(new FileReader("../patches/net.minecraftforge.json")); } catch (IOException | ParseException e) { log.error(e); return; } Manifest currentManifestFile = gson.fromJson(currentJson.toString(), Manifest.class); String manifestForge = currentManifestFile.getForgeVersion(); String multiMCForge = (String) multiMCJson.get("version"); if (!manifestForge.contains(multiMCForge)) { log.error( "Current MultiMC Forge version is not the same as the current downloaded pack, please update this instance's Forge to {}", manifestForge); System.exit(1); } } } }
AbstractProcessor(Arguments arguments, DownloadHelper downloadHelper) { modHandlerHashMap.put(CurseFile.class, new CurseFileHandler(arguments, downloadHelper)); modHandlerHashMap.put(ThirdParty.class, new ThirdPartyModHandler(downloadHelper)); this.arguments = arguments; this.downloadHelper = downloadHelper; buildManifestList(arguments.getManifests()); }
private void defaultArguments(Arguments arguments) { if (CollectionUtils.isEmpty(arguments.getManifests())) { log.debug("No manifest supplied, using default {}", reference.getDefaultManifestFile()); arguments.setManifests(Lists.newArrayList(new File(reference.getDefaultManifestFile()))); } if (Strings.isNullOrEmpty(arguments.getModFolder())) { log.debug("No output folder supplied, using default \"mods\""); arguments.setModFolder("mods"); } if (noProcessArgsSupplied(arguments)) { arguments.setDownloadMods(true); } }