fix(cli): do not start MDS thread if not needed
This commit is contained in:
parent
602be371d1
commit
d5dfb18417
@ -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")
|
||||
|
@ -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()));
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user