Package org.geysermc.geyser.skin
Class SkinProvider
java.lang.Object
org.geysermc.geyser.skin.SkinProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic enumstatic enumstatic enumstatic classstatic final recordstatic final recordRepresents a full package of skin, cape, and geometry.static final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]Convert a BufferedImage to a byte[]static ExecutorServicestatic <T> TgetOrDefault(CompletableFuture<T> future, T defaultValue, int timeoutInSeconds) static BufferedImageimageDataToBufferedImage(byte[] imageData, int imageWidth, int imageHeight) Convert a byte[] to a BufferedImagestatic voidregisterCacheImageTask(GeyserImpl geyser) static BufferedImagerequestImage(String imageUrl, SkinProvider.CapeProvider provider) static CompletableFuture<@Nullable String>requestTexturesFromUsername(String username) Request textures from a player's usernamestatic CompletableFuture<@Nullable String>Request textures from a player's UUIDstatic BufferedImagescale(BufferedImage bufferedImage, int newWidth, int newHeight) static voidshutdown()static voidStores the adjusted skin with the ear texture to the cache
-
Constructor Details
-
SkinProvider
public SkinProvider()
-
-
Method Details
-
getExecutorService
-
shutdown
public static void shutdown() -
registerCacheImageTask
-
storeEarSkin
Stores the adjusted skin with the ear texture to the cache- Parameters:
skin- The skin to cache
-
requestImage
public static BufferedImage requestImage(String imageUrl, SkinProvider.CapeProvider provider) throws IOException - Throws:
IOException
-
requestTexturesFromUUID
Request textures from a player's UUID- Parameters:
uuid- the player's UUID without any hyphens- Returns:
- a completable GameProfile with textures included
-
requestTexturesFromUsername
Request textures from a player's username- Parameters:
username- the player's username- Returns:
- a completable GameProfile with textures included
-
scale
-
imageDataToBufferedImage
public static BufferedImage imageDataToBufferedImage(byte[] imageData, int imageWidth, int imageHeight) Convert a byte[] to a BufferedImage- Parameters:
imageData- The byte[] to convertimageWidth- The width of the target imageimageHeight- The height of the target image- Returns:
- The converted BufferedImage
-
bufferedImageToImageData
Convert a BufferedImage to a byte[]- Parameters:
image- The BufferedImage to convert- Returns:
- The converted byte[]
-
getOrDefault
-