Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quilt requires Minecraft version #90

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class QuiltInstaller : InstallerBase, IQuiltInstaller
static HttpClient Client => HttpClientHelper.DefaultClient;

public QuiltLoaderModel LoaderArtifact { get; set; }
public string MineCraftVersion { get; set; }

public string Install()
{
Expand All @@ -28,14 +29,14 @@ public string Install()

public async Task<string> InstallTaskAsync()
{
if (string.IsNullOrEmpty(InheritsFrom))
throw new NullReferenceException("InheritsFrom 不能为 null");
if (string.IsNullOrEmpty(MineCraftVersion))
throw new NullReferenceException("MineCraftVersion 不能为 null");
if (string.IsNullOrEmpty(RootPath))
throw new NullReferenceException("RootPath 不能为 null");

InvokeStatusChangedEvent("开始安装", 0);

var url = $"{DefaultMetaUrl}/v3/versions/loader/{InheritsFrom}/{LoaderArtifact.Version}/profile/json";
var url = $"{DefaultMetaUrl}/v3/versions/loader/{MineCraftVersion}/{LoaderArtifact.Version}/profile/json";

using var req = new HttpRequestMessage(HttpMethod.Get, url);
using var res = await Client.SendAsync(req);
Expand Down
1 change: 1 addition & 0 deletions ProjBobcat/ProjBobcat/Interface/IQuiltInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace ProjBobcat.Interface;
public interface IQuiltInstaller : IInstaller
{
QuiltLoaderModel LoaderArtifact { get; set; }
string MineCraftVersion { get; set; }
string Install();
Task<string> InstallTaskAsync();
}
Loading