mirror of
https://github.com/yawaflua/spworlds-csharp-library.git
synced 2025-12-10 04:29:25 +02:00
Update User.cs
This commit is contained in:
@@ -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}";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user