Class ServerCreationService
- Namespace
- McServerLauncher.Services
- Assembly
- McServerLauncher.dll
Generates the initial files of a new server: eula.txt, run.bat and a minimal server.properties with the chosen port (Minecraft fills in the rest on the first launch).
public class ServerCreationService
- Inheritance
-
ServerCreationService
- Inherited Members
Methods
WriteEula(string)
Accepts the Minecraft EULA by writing eula.txt.
public void WriteEula(string folder)
Parameters
folderstring
WriteForgeUserJvmArgs(string, int, int)
Writes user_jvm_args.txt with the configured RAM. Modern Forge's own run.bat/run.sh read this file, so launching outside the app uses the same memory settings.
public void WriteForgeUserJvmArgs(string folder, int minGb, int maxGb)
Parameters
WriteInitialProperties(string, int, string)
Writes a minimal server.properties with the port and MOTD if it doesn't exist yet. Minecraft fills in the rest of the default properties on startup.
public void WriteInitialProperties(string folder, int port, string motd)
Parameters
WriteRunBat(string, int, int, string, string)
Creates a run.bat equivalent to the one you would use manually (in case you want to launch it outside the app).
public void WriteRunBat(string folder, int minGb, int maxGb, string jarFile, string javaPath = "java")