Class SkinProvider

java.lang.Object
org.geysermc.geyser.skin.SkinProvider

public class SkinProvider extends Object
  • 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

      public static ExecutorService getExecutorService()
    • shutdown

      public static void shutdown()
    • registerCacheImageTask

      public static void registerCacheImageTask(GeyserImpl geyser)
    • requestImage

      public static BufferedImage requestImage(String imageUrl, boolean isCape) throws IOException
      Throws:
      IOException
    • shorthandUUID

      public static @Nullable String shorthandUUID(@Nullable UUID uuid)
    • expandUUID

      public static @Nullable UUID expandUUID(@Nullable String uuid)
    • requestUsernameFromUUID

      public static CompletableFuture<@Nullable String> requestUsernameFromUUID(UUID uuid)
      Request a player's username from their UUID
      Parameters:
      uuid - the player's UUID
      Returns:
      a completable username of the player
    • requestUUIDFromUsername

      public static CompletableFuture<@Nullable UUID> requestUUIDFromUsername(String username)
      Request a player's UUID from their username
      Parameters:
      username - the player's username
      Returns:
      a completable UUID of the player
    • requestTexturesFromUUID

      public static CompletableFuture<@Nullable String> requestTexturesFromUUID(UUID uuid)
      Request textures from a player's UUID
      Parameters:
      uuid - the player's UUID
      Returns:
      a completable GameProfile with textures included
    • requestTexturesFromUsername

      public static CompletableFuture<@Nullable String> requestTexturesFromUsername(String username)
      Request textures from a player's username
      Parameters:
      username - the player's username
      Returns:
      a completable GameProfile with textures included
    • scale

      public static BufferedImage scale(BufferedImage bufferedImage, int newWidth, int newHeight)
    • imageDataToBufferedImage

      public static BufferedImage imageDataToBufferedImage(byte[] imageData, int imageWidth, int imageHeight)
      Convert a byte[] to a BufferedImage
      Parameters:
      imageData - The byte[] to convert
      imageWidth - The width of the target image
      imageHeight - The height of the target image
      Returns:
      The converted BufferedImage
    • bufferedImageToImageData

      public static byte[] bufferedImageToImageData(BufferedImage image)
      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)