[Java] This messy plist parser should be fixed now

This commit is contained in:
Duy Tran Khanh authored and GitHub committed 2021-07-18 07:44:07 +07:00
1 parent 69e8f38894
commit 7c766a1a5d
1 file changed
+3 -3
@@ -58,9 +58,9 @@ public class PLaunchApp {
try {
String plistContent = Tools.read(Tools.DIR_APP_DATA + "/launcher_preferences.plist");
plistContent = plistContent.substring(plistContent.indexOf("<key>selected_version</key>") + 27);
mcver = plistContent.replace("<string>", "")
.substring(0, plistContent.indexOf("</")).trim();
plistContent = plistContent.substring(plistContent.indexOf("<key>selected_version</key>") + 27)
.replace("<string>", "")
mcver = plistContent.substring(0, plistContent.indexOf("</string>")).trim();
} catch (IOException e) {
e.printStackTrace();
UIKit.updateProgressSafe(0, "Could not parse plist, defaulting to Minecraft 1.16.5");