Interface MineSkinAPI
public interface MineSkinAPI
Generate Value and Signature for a skin image url using the MineSkin API
-
Method Summary
Modifier and TypeMethodDescriptiondefault MineSkinResponsegenSkin(byte[] pngData, @Nullable SkinVariant skinVariant) Shorthand forgenSkin(String, SkinVariant)with a call toBase64Utils.encodePNGAsUrl(byte[])to convert a PNG byte array to a data URI.default MineSkinResponsegenSkin(BufferedImage image, @Nullable SkinVariant skinVariant) Shorthand forgenSkin(String, SkinVariant)with a call toBase64Utils.encodePNGAsUrl(BufferedImage)to convert a BufferedImage to a data URI.default MineSkinResponsegenSkin(File file, @Nullable SkinVariant skinVariant) Shorthand forgenSkin(String, SkinVariant)with a call toBase64Utils.encodePNGAsUrl(File)to convert a PNG file to a data URI.genSkin(String url, @Nullable SkinVariant skinVariant) Generates a skin using the MineSkin API [WARNING] MineSkin api key might be REQUIRED in the future.default MineSkinResponsegenSkin(Path file, @Nullable SkinVariant skinVariant) Shorthand forgenSkin(String, SkinVariant)with a call toBase64Utils.encodePNGAsUrl(File)to convert a PNG file to a data URI.
-
Method Details
-
genSkin
MineSkinResponse genSkin(String url, @Nullable @Nullable SkinVariant skinVariant) throws DataRequestException, MineSkinException Generates a skin using the MineSkin API [WARNING] MineSkin api key might be REQUIRED in the future.- Parameters:
url- pointing to a skin image url can be a direct link to a PNG file on a website or a data URI (data:image/png;base64,...) useBase64Utils.encodePNGAsUrl(byte[])to convert a PNG file to a data URIskinVariant- can be null, steve or slim- Returns:
- Custom skin property containing "value" and "signature"
- Throws:
DataRequestException- on errorMineSkinException- when there was a MineSkin specific error
-
genSkin
default MineSkinResponse genSkin(File file, @Nullable @Nullable SkinVariant skinVariant) throws DataRequestException, MineSkinException, IOException Shorthand forgenSkin(String, SkinVariant)with a call toBase64Utils.encodePNGAsUrl(File)to convert a PNG file to a data URI.- Parameters:
file- pointing to a PNG fileskinVariant- can be null, steve or slim- Returns:
- Custom skin property containing "value" and "signature"
- Throws:
DataRequestException- on errorMineSkinException- when there was a MineSkin specific errorIOException- if the file cannot be read- See Also:
-
genSkin
default MineSkinResponse genSkin(Path file, @Nullable @Nullable SkinVariant skinVariant) throws DataRequestException, MineSkinException, IOException Shorthand forgenSkin(String, SkinVariant)with a call toBase64Utils.encodePNGAsUrl(File)to convert a PNG file to a data URI.- Parameters:
file- pointing to a PNG fileskinVariant- can be null, steve or slim- Returns:
- Custom skin property containing "value" and "signature"
- Throws:
DataRequestException- on errorMineSkinException- when there was a MineSkin specific errorIOException- if the file cannot be read- See Also:
-
genSkin
default MineSkinResponse genSkin(BufferedImage image, @Nullable @Nullable SkinVariant skinVariant) throws DataRequestException, MineSkinException, IOException Shorthand forgenSkin(String, SkinVariant)with a call toBase64Utils.encodePNGAsUrl(BufferedImage)to convert a BufferedImage to a data URI.- Parameters:
image- BufferedImage of a PNG imageskinVariant- can be null, steve or slim- Returns:
- Custom skin property containing "value" and "signature"
- Throws:
DataRequestException- on errorMineSkinException- when there was a MineSkin specific errorIOException- if the image cannot be converted to PNG- See Also:
-
genSkin
default MineSkinResponse genSkin(byte[] pngData, @Nullable @Nullable SkinVariant skinVariant) throws DataRequestException, MineSkinException Shorthand forgenSkin(String, SkinVariant)with a call toBase64Utils.encodePNGAsUrl(byte[])to convert a PNG byte array to a data URI.- Parameters:
pngData- byte array of a PNG imageskinVariant- can be null, steve or slim- Returns:
- Custom skin property containing "value" and "signature"
- Throws:
DataRequestException- on errorMineSkinException- when there was a MineSkin specific error- See Also:
-