mirror of
https://github.com/yawaflua/spworlds-csharp-library.git
synced 2025-12-10 12:29:30 +02:00
Update User.cs
кхм
This commit is contained in:
@@ -10,15 +10,15 @@ public class User
|
|||||||
|
|
||||||
private HttpClient client = new();
|
private HttpClient client = new();
|
||||||
|
|
||||||
public bool IsPlayer() => this.Name != null ? true : false;
|
public bool IsPlayer() => Name != null ? true : false;
|
||||||
|
|
||||||
public User()
|
public User(string name)
|
||||||
{
|
{
|
||||||
Uuid = JsonNode.Parse(await client.GetStringAsync($"https://api.mojang.com/users/profiles/minecraft/{Name}"))["id"];
|
Uuid = JsonNode.Parse(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}"));
|
profile = JsonNode.Parse(client.GetStringAsync($"https://sessionserver.mojang.com/session/minecraft/profile/{Uuid}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<string> GetSkinPart(SkinPart skinPart, string size = "64")
|
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.profile["profileId"]}"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user