make the skin renderer less bad (thanks bray)
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Failing after 17s
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Failing after 17s
This commit is contained in:
34
src/main/java/cc/fascinated/model/cache/CachedMinecraftServer.java
vendored
Normal file
34
src/main/java/cc/fascinated/model/cache/CachedMinecraftServer.java
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
package cc.fascinated.model.cache;
|
||||
|
||||
import cc.fascinated.model.server.MinecraftServer;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.*;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.redis.core.RedisHash;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Braydon
|
||||
*/
|
||||
@AllArgsConstructor @Setter @Getter @ToString
|
||||
@RedisHash(value = "server", timeToLive = 60L) // 1 minute (in seconds)
|
||||
public final class CachedMinecraftServer implements Serializable {
|
||||
/**
|
||||
* The id of this cached server.
|
||||
*/
|
||||
@Id @NonNull @JsonIgnore
|
||||
private final String id;
|
||||
|
||||
/**
|
||||
* The cached server.
|
||||
*/
|
||||
@NonNull
|
||||
private final MinecraftServer server;
|
||||
|
||||
/**
|
||||
* The unix timestamp of when this
|
||||
* server was cached, -1 if not cached.
|
||||
*/
|
||||
private long cached;
|
||||
}
|
34
src/main/java/cc/fascinated/model/cache/CachedPlayer.java
vendored
Normal file
34
src/main/java/cc/fascinated/model/cache/CachedPlayer.java
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
package cc.fascinated.model.cache;
|
||||
|
||||
import cc.fascinated.model.mojang.MojangProfile;
|
||||
import cc.fascinated.model.player.Cape;
|
||||
import cc.fascinated.model.player.Player;
|
||||
import cc.fascinated.model.skin.Skin;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.springframework.data.redis.core.RedisHash;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* A cacheable {@link Player}.
|
||||
*
|
||||
* @author Braydon
|
||||
*/
|
||||
@Setter @Getter
|
||||
@ToString(callSuper = true)
|
||||
@RedisHash(value = "player", timeToLive = 60L * 60L) // 1 hour (in seconds)
|
||||
public final class CachedPlayer extends Player implements Serializable {
|
||||
/**
|
||||
* The unix timestamp of when this
|
||||
* player was cached, -1 if not cached.
|
||||
*/
|
||||
private long cached;
|
||||
|
||||
public CachedPlayer(UUID uniqueId, String trimmedUniqueId, String username, Skin skin, Cape cape, MojangProfile.ProfileProperty[] rawProperties, long cached) {
|
||||
super(uniqueId, trimmedUniqueId, username, skin, cape, rawProperties);
|
||||
this.cached = cached;
|
||||
}
|
||||
}
|
27
src/main/java/cc/fascinated/model/cache/CachedPlayerName.java
vendored
Normal file
27
src/main/java/cc/fascinated/model/cache/CachedPlayerName.java
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
package cc.fascinated.model.cache;
|
||||
|
||||
import lombok.*;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.redis.core.RedisHash;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Braydon
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
|
||||
@ToString
|
||||
@RedisHash(value = "playerName", timeToLive = 60L * 60L) // 1 hour (in seconds)
|
||||
public final class CachedPlayerName {
|
||||
/**
|
||||
* The username of the player.
|
||||
*/
|
||||
@Id @NonNull private String username;
|
||||
|
||||
/**
|
||||
* The unique id of the player.
|
||||
*/
|
||||
@NonNull private UUID uniqueId;
|
||||
}
|
25
src/main/java/cc/fascinated/model/cache/CachedPlayerSkinPart.java
vendored
Normal file
25
src/main/java/cc/fascinated/model/cache/CachedPlayerSkinPart.java
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
package cc.fascinated.model.cache;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.redis.core.RedisHash;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@RedisHash(value = "player", timeToLive = 60L * 60L) // 1 hour (in seconds)
|
||||
public class CachedPlayerSkinPart {
|
||||
|
||||
/**
|
||||
* The ID of the skin part
|
||||
*/
|
||||
@Id @NonNull private String id;
|
||||
|
||||
/**
|
||||
* The skin part bytes
|
||||
*/
|
||||
private byte[] bytes;
|
||||
}
|
Reference in New Issue
Block a user