File tree Expand file tree Collapse file tree 3 files changed +21
-10
lines changed
src/main/java/io/github/zekerzhayard/forgewrapper/installer/detector Expand file tree Collapse file tree 3 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -91,10 +91,5 @@ publishing {
9191tasks. publish. dependsOn build
9292
9393static String getVersionSuffix () {
94- if (System . getenv(" IS_PUBLICATION" ) != null ) {
95- return " "
96- } else if (System . getenv(" GITHUB_RUN_NUMBER" ) != null && System . getenv(" GITHUB_SHA" ) != null ) {
97- return " -s." + System . getenv(" GITHUB_RUN_NUMBER" ) + " -" + System . getenv(" GITHUB_SHA" ). substring(0 , 7 )
98- }
99- return " -LOCAL"
94+ return " "
10095}
Original file line number Diff line number Diff line change 11
22org.gradle.daemon = false
33
4- fw_version = 1.5.5
4+ fw_version = mmc2
Original file line number Diff line number Diff line change @@ -179,14 +179,24 @@ default boolean checkExtraFiles(String forgeFullVersion) {
179179 // Check all cached libraries.
180180 boolean checked = true ;
181181 for (Map .Entry <String , Path > entry : libsMap .entrySet ()) {
182- checked = checkExtraFile (entry .getValue (), hashMap .get (entry .getKey () + "_SHA" ));
182+ String sha1 = "" ;
183+ String entryKey = entry .getKey ();
184+ /**
185+ * NOTE: workaround for https://github.com/MultiMC/Launcher/issues/4400
186+ * We ignore the hash of the client file and instead just rely on it being 'correct, maybe' if it's present at all
187+ */
188+ System .out .println ("Checking: " + entryKey );
189+ if (!entryKey .equals ("PATCHED" )) {
190+ sha1 = hashMap .get (entryKey + "_SHA" );
191+ }
192+ checked = checkExtraFile (entry .getValue (), sha1 );
183193 if (!checked ) {
184194 System .out .println ("Missing: " + entry .getValue ());
185195 break ;
186196 }
187197 }
188198 return checked ;
189- }
199+ }
190200 // Skip installing process if installer profile doesn't exist.
191201 return true ;
192202 }
@@ -198,7 +208,13 @@ default boolean checkExtraFiles(String forgeFullVersion) {
198208 * @return True represents the file is ready.
199209 */
200210 static boolean checkExtraFile (Path path , String sha1 ) {
201- return sha1 == null || sha1 .equals ("" ) || (isFile (path ) && sha1 .toLowerCase (Locale .ENGLISH ).equals (getFileSHA1 (path )));
211+ if (!isFile (path )) {
212+ return false ;
213+ }
214+ if (sha1 == null || sha1 .equals ("" )) {
215+ return true ;
216+ }
217+ return sha1 .toLowerCase (Locale .ENGLISH ).equals (getFileSHA1 (path ));
202218 }
203219
204220 static boolean isFile (Path path ) {
You can’t perform that action at this time.
0 commit comments