Update User.cs

This commit is contained in:
Dima YaFlay
2023-10-24 21:40:32 +03:00
committed by GitHub
parent 9aa976b234
commit 4b80139bee

View File

@@ -6,7 +6,6 @@ public class User
{
public string Name { get; }
public string Uuid { get; }
public JsonNode profile { get; }
public bool IsPlayer() => Name != null ? true : false;
@@ -24,7 +23,6 @@ public class User
using(HttpClient client = new())
{
uuid = (string)JsonNode.Parse(await client.GetStringAsync($"https://api.mojang.com/users/profiles/minecraft/{name}"))["id"];
profile = JsonNode.Parse(await client.GetStringAsync($"https://sessionserver.mojang.com/session/minecraft/profile/{uuid}"));
}
User user = new(name, uuid, profile);
return user;
@@ -32,6 +30,6 @@ public class User
public string GetSkinPart(SkinPart skinPart, string size = "64")
{
return (string)$"https://visage.surgeplay.com/{skinPart}/{size}/{this.profile["profileId"]}";
return (string)$"https://visage.surgeplay.com/{skinPart}/{size}/{this.uuid}";
}
}