diff --git a/src/main/java/me/braydon/mc/model/Player.java b/src/main/java/me/braydon/mc/model/Player.java index f785e46..7a744da 100644 --- a/src/main/java/me/braydon/mc/model/Player.java +++ b/src/main/java/me/braydon/mc/model/Player.java @@ -65,4 +65,13 @@ public class Player { * The profile actions this player has, null if none. */ private final ProfileAction[] profileActions; + + /** + * Is this player legacy? + *

+ * A "Legacy" player is a player that + * has not yet migrated to a Mojang account. + *

+ */ + private final boolean legacy; } \ No newline at end of file diff --git a/src/main/java/me/braydon/mc/model/cache/CachedPlayer.java b/src/main/java/me/braydon/mc/model/cache/CachedPlayer.java index 0a2f091..0f57640 100644 --- a/src/main/java/me/braydon/mc/model/cache/CachedPlayer.java +++ b/src/main/java/me/braydon/mc/model/cache/CachedPlayer.java @@ -65,8 +65,8 @@ public final class CachedPlayer extends Player implements Serializable { public CachedPlayer(@NonNull String cacheId, @NonNull UUID uniqueId, @NonNull String username, @NonNull Skin skin, Cape cape, @NonNull MojangProfileToken.ProfileProperty[] properties, ProfileAction[] profileActions, - long cached) { - super(uniqueId, username, skin, cape, properties, profileActions); + boolean legacy, long cached) { + super(uniqueId, username, skin, cape, properties, profileActions, legacy); this.cacheId = cacheId; this.cached = cached; } diff --git a/src/main/java/me/braydon/mc/model/token/MojangProfileToken.java b/src/main/java/me/braydon/mc/model/token/MojangProfileToken.java index 1ea12dd..ed9068d 100644 --- a/src/main/java/me/braydon/mc/model/token/MojangProfileToken.java +++ b/src/main/java/me/braydon/mc/model/token/MojangProfileToken.java @@ -61,6 +61,15 @@ public final class MojangProfileToken { */ @NonNull private final ProfileAction[] profileActions; + /** + * Is this profile legacy? + *

+ * A "Legacy" profile is a profile that + * has not yet migrated to a Mojang account. + *

+ */ + private final boolean legacy; + /** * Get the properties of this skin. * diff --git a/src/main/java/me/braydon/mc/service/MojangService.java b/src/main/java/me/braydon/mc/service/MojangService.java index 3d905fc..0d51095 100644 --- a/src/main/java/me/braydon/mc/service/MojangService.java +++ b/src/main/java/me/braydon/mc/service/MojangService.java @@ -294,7 +294,7 @@ public final class MojangService { CachedPlayer player = new CachedPlayer(cacheId, uuid, token.getName(), skinProperties.getSkin() == null ? Skin.DEFAULT_STEVE : skinProperties.getSkin(), skinProperties.getCape(), token.getProperties(), profileActions.length == 0 ? null : profileActions, - System.currentTimeMillis() + token.isLegacy(), System.currentTimeMillis() ); // Store in the cache playerCache.save(player);