Add profile properties to Player
This commit is contained in:
parent
160fed45e8
commit
16a42d1af3
@ -24,6 +24,7 @@
|
|||||||
package me.braydon.mc.model;
|
package me.braydon.mc.model;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
import me.braydon.mc.model.token.MojangProfileToken;
|
||||||
import org.springframework.data.annotation.Id;
|
import org.springframework.data.annotation.Id;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -33,9 +34,7 @@ import java.util.UUID;
|
|||||||
*
|
*
|
||||||
* @author Braydon
|
* @author Braydon
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor @Getter
|
@AllArgsConstructor @Getter @EqualsAndHashCode(onlyExplicitlyIncluded = true) @ToString
|
||||||
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
|
|
||||||
@ToString
|
|
||||||
public class Player {
|
public class Player {
|
||||||
/**
|
/**
|
||||||
* The unique id of this player.
|
* The unique id of this player.
|
||||||
@ -57,6 +56,11 @@ public class Player {
|
|||||||
*/
|
*/
|
||||||
private final Cape cape;
|
private final Cape cape;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The raw profile properties of this player.
|
||||||
|
*/
|
||||||
|
@NonNull private final MojangProfileToken.ProfileProperty[] properties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The profile actions this player has, null if none.
|
* The profile actions this player has, null if none.
|
||||||
*/
|
*/
|
||||||
|
@ -31,6 +31,7 @@ import me.braydon.mc.model.Cape;
|
|||||||
import me.braydon.mc.model.Player;
|
import me.braydon.mc.model.Player;
|
||||||
import me.braydon.mc.model.ProfileAction;
|
import me.braydon.mc.model.ProfileAction;
|
||||||
import me.braydon.mc.model.Skin;
|
import me.braydon.mc.model.Skin;
|
||||||
|
import me.braydon.mc.model.token.MojangProfileToken;
|
||||||
import org.springframework.data.redis.core.RedisHash;
|
import org.springframework.data.redis.core.RedisHash;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -51,9 +52,10 @@ public final class CachedPlayer extends Player implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private long cached;
|
private long cached;
|
||||||
|
|
||||||
public CachedPlayer(@NonNull UUID uniqueId, @NonNull String username,
|
public CachedPlayer(@NonNull UUID uniqueId, @NonNull String username, @NonNull Skin skin, Cape cape,
|
||||||
@NonNull Skin skin, Cape cape, ProfileAction[] profileActions, long cached) {
|
@NonNull MojangProfileToken.ProfileProperty[] properties, ProfileAction[] profileActions,
|
||||||
super(uniqueId, username, skin, cape, profileActions);
|
long cached) {
|
||||||
|
super(uniqueId, username, skin, cape, properties, profileActions);
|
||||||
this.cached = cached;
|
this.cached = cached;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package me.braydon.mc.model.token;
|
package me.braydon.mc.model.token;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import me.braydon.mc.config.AppConfig;
|
import me.braydon.mc.config.AppConfig;
|
||||||
@ -123,7 +124,7 @@ public final class MojangProfileToken {
|
|||||||
*
|
*
|
||||||
* @return the decoded value
|
* @return the decoded value
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull @JsonIgnore
|
||||||
public String getDecodedValue() {
|
public String getDecodedValue() {
|
||||||
return new String(Base64.getDecoder().decode(value));
|
return new String(Base64.getDecoder().decode(value));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user