Class SkinProvider

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

public class SkinProvider extends Object
  • Constructor Details

    • SkinProvider

      public SkinProvider()
  • Method Details

    • shutdown

      public static void shutdown()
    • registerCacheImageTask

      public static void registerCacheImageTask(GeyserImpl geyser)
    • storeEarSkin

      public static void storeEarSkin(SkinProvider.Skin skin)
      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

      public static CompletableFuture<@Nullable String> requestTexturesFromUUID(String uuid)
      Request textures from a player's UUID
      Parameters:
      uuid - the player's UUID without any hyphens
      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)