Package org.geysermc.geyser.skin
Class SkinProvider
java.lang.Object
org.geysermc.geyser.skin.SkinProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.cloudburstmc.protocol.bedrock.data.skin.SerializedSkin -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]Convert a BufferedImage to a byte[]static org.geysermc.geyser.api.skin.SkinDataIf skin data fails to apply, or there is no skin data to apply, determine what skin we should give as a fallback.static @Nullable UUIDexpandUUID(@Nullable String uuid) 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, boolean isCape) static CompletableFuture<@Nullable String> requestTexturesFromUsername(String username) Request textures from a player's usernamestatic CompletableFuture<@Nullable String> requestTexturesFromUUID(UUID uuid) Request textures from a player's UUIDstatic CompletableFuture<@Nullable String> requestUsernameFromUUID(UUID uuid) Request a player's username from their UUIDstatic CompletableFuture<@Nullable UUID> requestUUIDFromUsername(String username) Request a player's UUID from their usernamestatic BufferedImagescale(BufferedImage bufferedImage, int newWidth, int newHeight) static @Nullable StringshorthandUUID(@Nullable UUID uuid) static voidshutdown()
-
Field Details
-
EMPTY_SERIALIZED_SKIN
public static final org.cloudburstmc.protocol.bedrock.data.skin.SerializedSkin EMPTY_SERIALIZED_SKIN
-
-
Constructor Details
-
SkinProvider
public SkinProvider()
-
-
Method Details
-
getExecutorService
-
shutdown
public static void shutdown() -
registerCacheImageTask
-
determineFallbackSkinData
If skin data fails to apply, or there is no skin data to apply, determine what skin we should give as a fallback. -
requestImage
- Throws:
IOException
-
shorthandUUID
-
expandUUID
-
requestUsernameFromUUID
Request a player's username from their UUID- Parameters:
uuid- the player's UUID- Returns:
- a completable username of the player
-
requestUUIDFromUsername
Request a player's UUID from their username- Parameters:
username- the player's username- Returns:
- a completable UUID of the player
-
requestTexturesFromUUID
Request textures from a player's UUID- Parameters:
uuid- the player's UUID- 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
-