diff --git a/Launcher/source-authlib/yggdrasil/CompatProfile.java b/Launcher/source-authlib/yggdrasil/CompatProfile.java index 6d3a0e3..d377da0 100644 --- a/Launcher/source-authlib/yggdrasil/CompatProfile.java +++ b/Launcher/source-authlib/yggdrasil/CompatProfile.java @@ -2,11 +2,19 @@ import java.util.UUID; +import launcher.LauncherAPI; import launcher.client.ClientLauncher; import launcher.client.PlayerProfile; import launcher.helper.SecurityHelper; +@LauncherAPI public final class CompatProfile { + public static final String SKIN_URL_PROPERTY = ClientLauncher.SKIN_URL_PROPERTY; + public static final String SKIN_DIGEST_PROPERTY = ClientLauncher.SKIN_DIGEST_PROPERTY; + public static final String CLOAK_URL_PROPERTY = ClientLauncher.CLOAK_URL_PROPERTY; + public static final String CLOAK_DIGEST_PROPERTY = ClientLauncher.CLOAK_DIGEST_PROPERTY; + + // Instance public final UUID uuid; public final String uuidHash, username; public final String skinURL, skinHash; @@ -14,7 +22,7 @@ public CompatProfile(UUID uuid, String username, String skinURL, String skinHash, String cloakURL, String cloakHash) { this.uuid = uuid; - this.uuidHash = ClientLauncher.toHash(uuid); + uuidHash = ClientLauncher.toHash(uuid); this.username = username; this.skinURL = skinURL; this.skinHash = skinHash; @@ -22,6 +30,23 @@ this.cloakHash = cloakHash; } + public int countProperties() { + int count = 0; + if (skinURL != null) { + count++; + } + if (skinHash != null) { + count++; + } + if (cloakURL != null) { + count++; + } + if (cloakHash != null) { + count++; + } + return count; + } + public static CompatProfile fromPlayerProfile(PlayerProfile profile) { return profile == null ? null : new CompatProfile(profile.uuid, profile.username, profile.skin == null ? null : profile.skin.url,