Class LoaderChangeService
- Namespace
- McServerLauncher.Services
- Assembly
- McServerLauncher.dll
Changes a server from one type to another — Vanilla into a loader, a loader into another, or back to Vanilla — without touching the world.
public sealed class LoaderChangeService
- Inheritance
-
LoaderChangeService
- Inherited Members
Remarks
The work of the Loader page's Install button, taken out of its click handler so the page keeps only the form and the busy state. It does not change the server's config: it returns what the install produced and the page writes it, because the config is the page's draft and only the page knows whether the write may happen.
The order matters. The user's run.bat is read first, because the Forge and NeoForge
installers overwrite it; the content of the old family is archived under the name the OLD type
used, before anything is installed; and only then is the jar installed.
Constructors
LoaderChangeService(MinecraftVersionService?, ServerJarInstaller?, ServerCreationService?, JavaService?)
public LoaderChangeService(MinecraftVersionService? versions = null, ServerJarInstaller? installer = null, ServerCreationService? creation = null, JavaService? java = null)
Parameters
versionsMinecraftVersionServiceinstallerServerJarInstallercreationServerCreationServicejavaJavaService
Methods
ConvertAsync(LoaderChange, Action<string>)
Installs change.To in the server's folder and returns what changed.
public Task<LoaderChangeResult> ConvertAsync(LoaderChange change, Action<string> log)
Parameters
changeLoaderChangeWhat to convert, already checked by the page.
logAction<string>Told what is happening, line by line. Called on the caller's context.