MinecraftResourceUtils.m: fix unexpected states

Fix: could not find inhertisFrom, launch even when download fails.

Other changes: log shown dialog, fix compile warning
This commit is contained in:
Duy Tran Khanh committed 2022-08-12 19:27:01 +07:00
1 parent 38c41d65d9
commit 57031041e2
3 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -228,7 +228,7 @@ int launchJVM(NSString *username, id launchTarget, int width, int height, int mi
margv[++margc] = jnaLibPath;
margv[++margc] = userDir;
margv[++margc] = userHome;
margv[++margc] = [NSString stringWithFormat:@"-DUIScreen.maximumFramesPerSecond=%d", UIScreen.mainScreen.maximumFramesPerSecond].UTF8String;
margv[++margc] = (char *)[NSString stringWithFormat:@"-DUIScreen.maximumFramesPerSecond=%d", (int)UIScreen.mainScreen.maximumFramesPerSecond].UTF8String;
margv[++margc] = "-Dorg.lwjgl.system.allocator=system";
margv[++margc] = "-Dlog4j2.formatMsgNoLookups=true";
if([getPreference(@"arccapes_enable") boolValue]) {
+2 -1
View File
@@ -259,6 +259,7 @@ static AFURLSessionManager* manager;
id inheritsFrom = [self findVersion:json[@"inheritsFrom"] inList:remoteVersionList];
if (inheritsFrom != nil) {
[self processVersion:json inheritsFrom:inheritsFrom progress:mainProgress callback:callback success:success];
return;
}
// If the inheritsFrom is not found, return an error
@@ -473,7 +474,7 @@ static AFURLSessionManager* manager;
mainProgress.totalUnitCount = [json[@"libraries"] count] + [json[@"assetIndexObj"][@"objects"] count];
id wrappedCallback = ^(NSString *s, NSProgress *p) {
dispatch_async(dispatch_get_main_queue(), ^{
callback(s, mainProgress, p);
callback(s, s?mainProgress:nil, p);
});
};
+3 -1
View File
@@ -21,6 +21,8 @@ jclass class_CTCAndroidInput;
jmethodID method_ReceiveInput;
void internal_showDialog(UIViewController *viewController, NSString* title, NSString* message) {
NSLog(@"Dialog shown: %@: %@", title, message);
UIAlertController* alert = [UIAlertController alertControllerWithTitle:title
message:message
preferredStyle:UIAlertControllerStyleAlert];
@@ -45,7 +47,7 @@ JNIEXPORT void JNICALL Java_net_kdt_pojavlaunch_uikit_UIKit_showError(JNIEnv* en
(*env)->ReleaseStringUTFChars(env, title, title_c);
(*env)->ReleaseStringUTFChars(env, message, message_c);
NSLog(@"Dialog shown: %@: %@", title_o, message_o);
NSLog(@"Dialog shown from Java: %@: %@", title_o, message_o);
dispatch_async(dispatch_get_main_queue(), ^{