64 lines
2.4 KiB
C#
64 lines
2.4 KiB
C#
using Mlaumcherb.Client.Avalonia.зримое;
|
||
|
||
namespace Mlaumcherb.Client.Avalonia.холопы;
|
||
|
||
public static class PathHelper
|
||
{
|
||
public static IOPath GetRootFullPath() =>
|
||
System.IO.Path.GetFullPath(new IOPath(LauncherApp.Config.minecraft_dir).ToString());
|
||
|
||
public static IOPath GetAssetsDir() =>
|
||
Path.Concat(GetRootFullPath(), "assets");
|
||
|
||
public static IOPath GetAssetIndexFilePath(string id) =>
|
||
Path.Concat(GetAssetsDir(), $"indexes/{id}.json"); // this path is hardcoded in the game
|
||
|
||
public static IOPath GetVersionDescriptorPath(string id) =>
|
||
Path.Concat(GetVersionDir(id), id + ".json");
|
||
|
||
public static IOPath GetVersionsDir() =>
|
||
Path.Concat(GetRootFullPath(), "versions");
|
||
|
||
public static IOPath GetVersionDir(string id) =>
|
||
Path.Concat(GetVersionsDir(), id);
|
||
|
||
public static IOPath GetVersionJarFilePath(string id) =>
|
||
Path.Concat(GetVersionDir(id), id + ".jar");
|
||
|
||
public static IOPath GetLibrariesDir() =>
|
||
Path.Concat(GetRootFullPath(), "libraries");
|
||
|
||
public static IOPath GetNativeLibrariesDir(string id) =>
|
||
Path.Concat(GetVersionDir(id), "natives", PlatformHelper.GetOsAndArch());
|
||
|
||
public static IOPath GetJavaRuntimesDir() =>
|
||
Path.Concat(GetRootFullPath(), "java");
|
||
|
||
|
||
public static IOPath GetJavaRuntimeDir(string id) =>
|
||
Path.Concat(GetJavaRuntimesDir(), PlatformHelper.GetOsAndArch(), id);
|
||
|
||
public static IOPath GetJavaBinDir(string id) =>
|
||
Path.Concat(GetJavaRuntimeDir(id), "bin");
|
||
public static IOPath GetJavaExecutablePath(string id, bool debug)
|
||
{
|
||
string executable_name = "java";
|
||
if (debug)
|
||
executable_name += "w";
|
||
if(OperatingSystem.IsWindows())
|
||
executable_name += ".exe";
|
||
return Path.Concat(GetJavaBinDir(id), executable_name);
|
||
}
|
||
|
||
public static string GetLog4jConfigFileName() => "log4j.xml";
|
||
|
||
public static IOPath GetLog4jConfigFilePath() =>
|
||
Path.Concat(GetAssetsDir(), GetLog4jConfigFileName());
|
||
|
||
public static IOPath GetModpackDescriptorPath(string game_version) =>
|
||
Path.Concat(GetVersionDir(game_version), "timerix_modpack.json");
|
||
|
||
public static IOPath GetModpackManifestPath(string game_version) =>
|
||
Path.Concat(GetVersionDir(game_version), "timerix_modpack_files.json");
|
||
}
|