Merge pull request #3303 from getchoo-contrib/backport-3179-to-release-9.x

[Backport release-9.x] Fix $INST_JAVA not being set for auto download java
This commit is contained in:
Alexandru Ionut Tripon 2025-01-17 08:56:39 +02:00 committed by GitHub
commit ae84a78470
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1083,13 +1083,6 @@ shared_qobject_ptr<LaunchTask> MinecraftInstance::createLaunchTask(AuthSessionPt
process->appendStep(step);
}
// run pre-launch command if that's needed
if (getPreLaunchCommand().size()) {
auto step = makeShared<PreLaunchCommand>(pptr);
step->setWorkingDirectory(gameRoot());
process->appendStep(step);
}
// load meta
{
auto mode = session->status != AuthSession::PlayableOffline ? Net::Mode::Online : Net::Mode::Offline;
@ -1102,6 +1095,13 @@ shared_qobject_ptr<LaunchTask> MinecraftInstance::createLaunchTask(AuthSessionPt
process->appendStep(makeShared<CheckJava>(pptr));
}
// run pre-launch command if that's needed
if (getPreLaunchCommand().size()) {
auto step = makeShared<PreLaunchCommand>(pptr);
step->setWorkingDirectory(gameRoot());
process->appendStep(step);
}
// if we aren't in offline mode,.
if (session->status != AuthSession::PlayableOffline) {
if (!session->demo) {