Package org.geysermc.geyser.skin
Class SkinProvider
java.lang.Object
org.geysermc.geyser.skin.SkinProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classRepresents a full package of skin, cape, and geometry.static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]Convert a BufferedImage to a byte[]static <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<String>requestTexturesFromUsername(String username)Request textures from a player's usernamestatic CompletableFuture<String>requestTexturesFromUUID(String uuid)Request textures from a player's UUIDstatic BufferedImagescale(BufferedImage bufferedImage, int newWidth, int newHeight)static voidshutdown()static voidstoreEarSkin(SkinProvider.Skin skin)Stores the adjusted skin with the ear texture to the cache
-
Constructor Details
-
SkinProvider
public SkinProvider()
-
-
Method Details
-
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
public static <T> T getOrDefault(CompletableFuture<T> future, T defaultValue, int timeoutInSeconds)
-