This repository was archived by the owner on Sep 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ private static String getModVersion(JSONObject manifest) {
197197 String version = (String ) minecraft .get ("version" );
198198 String id = (String ) ((JSONObject ) optional .get ()).get ("id" );
199199 String [] splitted = id .split ("-" );
200- String loader = splitted [0 ];
200+ String loader = splitted [0 ]. toLowerCase () ;
201201 String modVer = Arrays .stream (splitted ).skip (1 ).collect (Collectors .joining ("-" ));
202202 List <String > versions = Arrays .stream (new File (Utils .getMinecraftPath () + File .separator + "versions" ).listFiles ()).map (File ::getName ).collect (Collectors .toList ());
203203 Optional <String > found = versions .stream ().filter (name -> name .contains (loader ) && name .contains (modVer ) && name .contains (version )).findFirst ();
@@ -208,7 +208,7 @@ private static String getModVersion(JSONObject manifest) {
208208 else if (loader .equalsIgnoreCase ("fabric" )) System .out .println ((Ansi .ansi ().a ("https://fabricmc.net/use/installer/" )).reset ());
209209 else if (loader .equalsIgnoreCase ("quilt" )) System .out .println (Ansi .ansi ().a ("https://quiltmc.org/en/install/" ).reset ());
210210 if (Utils .readYesNo ()) {
211- versions = Arrays .stream (new File (Utils .getMinecraftPath () + File .separator + "versions" ).listFiles ()).map (File :: getName ).collect (Collectors .toList ());
211+ versions = Arrays .stream (new File (Utils .getMinecraftPath () + File .separator + "versions" ).listFiles ()).map (f -> f . getName (). toLowerCase () ).collect (Collectors .toList ());
212212 found = versions .stream ().filter (name -> name .contains (loader ) && name .contains (modVer ) && name .contains (version )).findFirst ();
213213 if (found .isPresent ()) return found .get ();
214214 System .out .println (Ansi .ansi ().fg (Ansi .Color .YELLOW ).a ("We still couldn't find the mod launcher version required! The installation will continue anyway. You may have to change the profile settings after this." ));
Original file line number Diff line number Diff line change @@ -57,13 +57,13 @@ private static void create() {
5757 System .out .print (Ansi .ansi ().fg (Ansi .Color .YELLOW ).a ("The version is invalid. Minecraft version: " ).reset ());
5858 }
5959 }
60- System .out .print (Ansi .ansi ().fg (Ansi .Color .YELLOW ).a ("Mod launcher [forge/fabric]: " ).reset ());
60+ System .out .print (Ansi .ansi ().fg (Ansi .Color .YELLOW ).a ("Mod launcher [forge/fabric/quilt ]: " ).reset ());
6161 String launcher = null ;
6262 while (launcher == null ) {
6363 launcher = scanner .nextLine ().toLowerCase ();
64- if (!launcher .equalsIgnoreCase ("forge" ) && !launcher .equalsIgnoreCase ("fabric" )) {
64+ if (!launcher .equalsIgnoreCase ("forge" ) && !launcher .equalsIgnoreCase ("fabric" ) && ! launcher . equalsIgnoreCase ( "quilt" ) ) {
6565 launcher = null ;
66- System .out .println (Ansi .ansi ().fg (Ansi .Color .YELLOW ).a ("The launcher is invalid. Mod launcher [forge/fabric]: " ).reset ().a ("\r " ));
66+ System .out .println (Ansi .ansi ().fg (Ansi .Color .YELLOW ).a ("The launcher is invalid. Mod launcher [forge/fabric/quilt ]: " ).reset ().a ("\r " ));
6767 }
6868 }
6969 System .out .print (Ansi .ansi ().fg (Ansi .Color .YELLOW ).a ("Mod launcher version: " ).reset ());
Original file line number Diff line number Diff line change @@ -220,7 +220,6 @@ public static boolean checkVersion(JSONArray versions, JSONObject config) {
220220 String requiredVer = (String ) config .get ("mcVer" );
221221 String launcher = (String ) config .get ("launcher" );
222222 boolean launcherMatch = false , versionMatch = false ;
223- // Assume it is ok if no launcher is specified by the mod file
224223 int trueCount = 0 ;
225224 for (String s : LAUNCHERS )
226225 if (versions .contains (s )) {
@@ -230,7 +229,10 @@ public static boolean checkVersion(JSONArray versions, JSONObject config) {
230229 }
231230 trueCount ++;
232231 }
232+ // Assume it is ok if no launcher is specified by the mod file
233233 if (trueCount == 0 ) launcherMatch = true ;
234+ // Special relationship of fabric and quilt
235+ if (!launcherMatch && launcher .equalsIgnoreCase ("quilt" ) && versions .contains ("fabric" )) launcherMatch = true ;
234236 if (!versions .contains (requiredVer )) {
235237 if (Config .acceptParentVersionMod && versions .contains (parentVersion (requiredVer ))) versionMatch = true ;
236238 else if (!versions .contains (parentVersion (requiredVer )) && versions .stream ().noneMatch (ver -> isMCVersionValid ((String ) ver ))) versionMatch = true ;
You can’t perform that action at this time.
0 commit comments