fix(cli): do not start MDS thread if not needed
Some checks failed
ci/woodpecker/push/docs Pipeline failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Johannes Frohnmeyer 2024-06-22 21:06:21 +02:00
parent 602be371d1
commit d5dfb18417
Signed by: Johannes
GPG Key ID: E76429612C2929F4
3 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package io.gitlab.jfronny.inceptum.gtk.window.create
import io.gitlab.jfronny.commons.StringFormatter
import io.gitlab.jfronny.inceptum.common.InceptumConfig
import io.gitlab.jfronny.inceptum.common.MetaHolder
import io.gitlab.jfronny.inceptum.gtk.backgroundTask
import io.gitlab.jfronny.inceptum.gtk.control.KDropDown
import io.gitlab.jfronny.inceptum.gtk.control.KEntry
@ -16,6 +17,7 @@ import io.gitlab.jfronny.inceptum.launcher.api.FabricMetaApi
import io.gitlab.jfronny.inceptum.launcher.api.McApi
import io.gitlab.jfronny.inceptum.launcher.model.fabric.FabricVersionLoaderInfo
import io.gitlab.jfronny.inceptum.launcher.model.mojang.VersionsListInfo
import io.gitlab.jfronny.inceptum.launcher.system.instance.InstanceList
import io.gitlab.jfronny.inceptum.launcher.system.instance.InstanceNameTool
import io.gitlab.jfronny.inceptum.launcher.system.instance.LoaderInfo
import io.gitlab.jfronny.inceptum.launcher.system.setup.SetupStepInfo
@ -149,6 +151,7 @@ class NewInstanceWindow(app: Application) : KAssistant(app) {
step.execute(state)
}
state.clearSetupLock()
InstanceList.read(MetaHolder.INSTANCE_DIR.resolve(state.name)).mds.start()
} catch (e: Throwable) {
pState.cancel()
Log.error("Could not create instance")

View File

@ -50,6 +50,7 @@ public class GuiUtil {
step.execute(state);
}
state.clearSetupLock();
InstanceList.read(MetaHolder.INSTANCE_DIR.resolve(state.name())).mds().start();
LauncherEnv.showInfo("The instance was successfully created. You can now launch it using the main menu", "Successfully installed");
}, t -> state.tryRemoveInstance()));
}

View File

@ -19,7 +19,6 @@ public class RunMdsStep implements Step {
Path instance = MetaHolder.INSTANCE_DIR.resolve(info.name());
var mds = ModsDirScanner.get(instance.resolve("mods"), GC_InstanceMeta.deserialize(instance.resolve(Instance.CONFIG_NAME), GsonPreset.CONFIG));
mds.runOnce(ScanStage.DOWNLOAD, (path, iwModDescription) -> info.setState("Scanned " + path));
mds.start();
}
@Override