public class SkinProvider extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SkinProvider.Cape |
static class |
SkinProvider.CapeProvider |
static class |
SkinProvider.CapeUrlType |
static class |
SkinProvider.EarsProvider |
static class |
SkinProvider.Skin |
static class |
SkinProvider.SkinAndCape |
static class |
SkinProvider.SkinGeometry |
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
ALEX_SKIN |
static boolean |
ALLOW_THIRD_PARTY_CAPES |
static boolean |
ALLOW_THIRD_PARTY_EARS |
static String |
EARS_GEOMETRY |
static String |
EARS_GEOMETRY_SLIM |
static SkinProvider.Cape |
EMPTY_CAPE |
static SkinProvider.Skin |
EMPTY_SKIN |
static SkinProvider.Skin |
EMPTY_SKIN_ALEX |
static com.fasterxml.jackson.databind.ObjectMapper |
OBJECT_MAPPER |
static SkinProvider.SkinGeometry |
SKULL_GEOMETRY |
static byte[] |
STEVE_SKIN |
| Constructor and Description |
|---|
SkinProvider() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
bufferedImageToImageData(BufferedImage image)
Convert a BufferedImage to a byte[]
|
static SkinProvider.Cape |
getCachedCape(String capeUrl) |
static SkinProvider.Skin |
getCachedSkin(String skinUrl) |
static <T> T |
getOrDefault(CompletableFuture<T> future,
T defaultValue,
int timeoutInSeconds) |
static boolean |
hasCapeCached(String capeUrl) |
static BufferedImage |
imageDataToBufferedImage(byte[] imageData,
int imageWidth,
int imageHeight)
Convert a byte[] to a BufferedImage
|
static CompletableFuture<SkinProvider.Cape> |
requestBedrockCape(UUID playerID) |
static CompletableFuture<SkinProvider.SkinGeometry> |
requestBedrockGeometry(SkinProvider.SkinGeometry currentGeometry,
UUID playerID) |
static CompletableFuture<SkinProvider.Cape> |
requestCape(String capeUrl,
SkinProvider.CapeProvider provider,
boolean newThread) |
static CompletableFuture<SkinProvider.Skin> |
requestEars(String earsUrl,
boolean newThread,
SkinProvider.Skin skin) |
static CompletableFuture<SkinProvider.Skin> |
requestSkin(UUID playerId,
String textureUrl,
boolean newThread) |
static CompletableFuture<SkinProvider.SkinAndCape> |
requestSkinAndCape(UUID playerId,
String skinUrl,
String capeUrl) |
static CompletableFuture<com.github.steveice10.mc.auth.data.GameProfile> |
requestTexturesFromUsername(com.github.steveice10.opennbt.tag.builtin.CompoundTag skullOwner)
If a skull has a username but no textures, request them.
|
static CompletableFuture<SkinProvider.Cape> |
requestUnofficialCape(SkinProvider.Cape officialCape,
UUID playerId,
String username,
boolean newThread) |
static CompletableFuture<SkinProvider.Skin> |
requestUnofficialEars(SkinProvider.Skin officialSkin,
UUID playerId,
String username,
boolean newThread)
Try and find an ear texture for a Java player
|
static BufferedImage |
scale(BufferedImage bufferedImage,
int newWidth,
int newHeight) |
static void |
storeBedrockCape(UUID playerID,
byte[] capeData) |
static void |
storeBedrockGeometry(UUID playerID,
byte[] geometryName,
byte[] geometryData) |
static void |
storeBedrockSkin(UUID playerID,
String skinID,
byte[] skinData) |
static void |
storeEarGeometry(UUID playerID,
boolean isSlim)
Stores the geometry for a Java player with ears
|
static void |
storeEarSkin(SkinProvider.Skin skin)
Stores the adjusted skin with the ear texture to the cache
|
public static final boolean ALLOW_THIRD_PARTY_CAPES
public static final byte[] STEVE_SKIN
public static final SkinProvider.Skin EMPTY_SKIN
public static final byte[] ALEX_SKIN
public static final SkinProvider.Skin EMPTY_SKIN_ALEX
public static final SkinProvider.Cape EMPTY_CAPE
public static final boolean ALLOW_THIRD_PARTY_EARS
public static final String EARS_GEOMETRY
public static final String EARS_GEOMETRY_SLIM
public static final SkinProvider.SkinGeometry SKULL_GEOMETRY
public static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
public static boolean hasCapeCached(String capeUrl)
public static SkinProvider.Skin getCachedSkin(String skinUrl)
public static SkinProvider.Cape getCachedCape(String capeUrl)
public static CompletableFuture<SkinProvider.SkinAndCape> requestSkinAndCape(UUID playerId, String skinUrl, String capeUrl)
public static CompletableFuture<SkinProvider.Skin> requestSkin(UUID playerId, String textureUrl, boolean newThread)
public static CompletableFuture<SkinProvider.Cape> requestCape(String capeUrl, SkinProvider.CapeProvider provider, boolean newThread)
public static CompletableFuture<SkinProvider.Cape> requestUnofficialCape(SkinProvider.Cape officialCape, UUID playerId, String username, boolean newThread)
public static CompletableFuture<SkinProvider.Skin> requestEars(String earsUrl, boolean newThread, SkinProvider.Skin skin)
public static CompletableFuture<SkinProvider.Skin> requestUnofficialEars(SkinProvider.Skin officialSkin, UUID playerId, String username, boolean newThread)
officialSkin - The current players skinplayerId - The players UUIDusername - The players usernamenewThread - Should we start in a new threadpublic static CompletableFuture<SkinProvider.Cape> requestBedrockCape(UUID playerID)
public static CompletableFuture<SkinProvider.SkinGeometry> requestBedrockGeometry(SkinProvider.SkinGeometry currentGeometry, UUID playerID)
public static void storeBedrockCape(UUID playerID, byte[] capeData)
public static void storeBedrockGeometry(UUID playerID, byte[] geometryName, byte[] geometryData)
public static void storeEarSkin(SkinProvider.Skin skin)
skin - The skin to cachepublic static void storeEarGeometry(UUID playerID, boolean isSlim)
playerID - The UUID to cache it againstisSlim - If the player is using an slim basepublic static CompletableFuture<com.github.steveice10.mc.auth.data.GameProfile> requestTexturesFromUsername(com.github.steveice10.opennbt.tag.builtin.CompoundTag skullOwner)
skullOwner - the CompoundTag of the skull with no texturespublic static BufferedImage scale(BufferedImage bufferedImage, int newWidth, int newHeight)
public static BufferedImage imageDataToBufferedImage(byte[] imageData, int imageWidth, int imageHeight)
imageData - The byte[] to convertimageWidth - The width of the target imageimageHeight - The height of the target imagepublic static byte[] bufferedImageToImageData(BufferedImage image)
image - The BufferedImage to convertpublic static <T> T getOrDefault(CompletableFuture<T> future, T defaultValue, int timeoutInSeconds)
Copyright © 2021 GeyserMC. All rights reserved.