Since Minecraft Snapshot 23w14a, there's a new feature called the Quick Play Mode
, it simply allow the game to join a specific server/local world/realms instantly after the game has finished its launching and initialization progress, and this such feature is implemented by adding launching arguments, check this by Mojang for details.
But while using CMCL to launch a newer version of Minecraft, say 1.20, these arguments that relate to the Quick Launch was always added.
--quickPlayPath ${quickPlayPath} --quickPlaySingleplayer ${quickPlaySingleplayer} --quickPlayMultiplayer ${quickPlayMultiplayer} --quickPlayRealms ${quickPlayRealms}
Which causing the game to run into the Quick Launch mode with no target level given and showing up like this.
![image](https://private-user-images.githubusercontent.com/89057904/244861627-0d84c517-05c3-4f9b-a5f5-a3c3800a8ba6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkwNTA3MzQsIm5iZiI6MTcxOTA1MDQzNCwicGF0aCI6Ii84OTA1NzkwNC8yNDQ4NjE2MjctMGQ4NGM1MTctMDVjMy00ZjliLWE1ZjUtYTNjMzgwMGE4YmE2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIyVDEwMDAzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ5ZTNiYjQ2YTExMjFjNWQ1YTRkZGUyNGUwMzhiMDUwYWMyZjQ2MzZlNzFjMDVhZjgwNjc1NTRhMTdhM2ZlNzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.mwlCadz8fAe5xxw77GP2bYX3LsHVWEDHq_pGT05sNn0)
To solve this, just not adding these arguments as always, but additionally. Maybe even add related settings to the config file?
##update##
Located problem in src\main\java\com\mrshiehx\cmcl\modules\MinecraftLauncher.java
, cauze you've done this minecraftArguments.addAll(argus);
at ln278, the arguments relate to the quick play will just added into the minecraftArguments
from the minecraftVersionJsonFile
of the newer versions of the Minecraft. To fix, you can add a filter while reassembling the launch arguments at ln311, within the for iterator.
I mean, add a settings into the config(cmcl.json), and if the user actually set the quickplay to true and provided the target world/server for the quick play in the config file, then assemble all the arguments like the current code from ln311 ~ ln316, and then complete them using the code pattern like the current one for enabling the quick play, elseif the user provided the incomplete information for the quick play, or just set it to false, then just cut off those arguments in the for iterator at ln311 ~ ln316 by filtering out those argument.key
by the keyword quickPlay
, if found, abandon those keys and their value.
Here is the code simply modified by my self, it removes any arguments relate to quick play therefore fixed the issue in a hard-coded way.
(line 310 in src\main\java\com\mrshiehx\cmcl\modules\MinecraftLauncher.java)
for (Argument argument : arguments1) {
if(!((String)argument.key).contains("quickPlay")){
minecraftArguments.add("--" + argument.key);
if (argument instanceof ValueArgument) {
minecraftArguments.add(((ValueArgument) argument).value);
}
}
}
One step forward, we can add a variable to represent whether or not enabling the quick play, so we can change the behavior of the code, like this
boolean enableQuickPlay = false;
for (Argument argument : arguments1) {
if(!((String)argument.key).contains("quickPlay") || enableQuickPlay){
minecraftArguments.add("--" + argument.key);
if (argument instanceof ValueArgument) {
minecraftArguments.add(((ValueArgument) argument).value);
}
}
}
and then if it got enabled, fill up those values (don't forget to dock these values to the config and read them from it)
...
if (s.contains(source = "${quickPlayPath}")) {
minecraftArguments.set(i, s = s.replace(source, String.valueOf(quickPlayPath)));
}
...
and that's it.