Package net.pinger.disguise
Interface SkinManager
public interface SkinManager
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getFromImage(String imageUrl, Consumer<Response<Skin>> response)
This method returns a newSkin
instance based on the provided image url.getFromMojang(String playerName)
This method returns a newSkin
instance based on the provided playerName.getFromMojang(UUID playerId)
This method returns a newSkin
instance based on the provided playerId.
-
Method Details
-
getFromImage
This method returns a newSkin
instance based on the provided image url.Because this method runs asynchronously, we are using a
Consumer
for the resulting response. One can determine whether this method ran successfully by checking theResponse.ResponseType
or justResponse.success()
.As of June 27th 2022, the response (success) format looks like this, where only a url is provided:
{ "id": 0, "idStr": "string", "uuid": "string", "name": "string", "variant": "classic", "data": { "uuid": "string", "texture": { "value": "string", "signature": "string", "url": "string" } }, "timestamp": 0, "duration": 0, "account": 0, "server": "string", "private": true, "views": 0, "nextRequest": 0, "duplicate": true }
- Parameters:
imageUrl
- the url of the imageresponse
- the response
-
getFromMojang
This method returns a newSkin
instance based on the provided playerName.Unlike
getFromImage(String, Consumer)
, this method does not run asynchronously. If the call to the REST API is successful, the response will look like this:{ "id" : "c8809dd609af4706a92b3f89f6433a67", "name" : "aha", "properties" : [ { "name" : "textures", "value" : "someValue", "signature" : "someSignature" } ] }
- Parameters:
playerName
- the playerName to catch the skin from- Returns:
- the new
Skin
instance, or null if failed - Throws:
UserNotFoundException
- if the specified name does not match any users
-
getFromMojang
This method returns a newSkin
instance based on the provided playerId.Unlike
getFromImage(String, Consumer)
, this method does not run asynchronously. If the call to the REST API is successful, the response will look like this:{ "id" : "c8809dd609af4706a92b3f89f6433a67", "name" : "aha", "properties" : [ { "name" : "textures", "value" : "someValue", "signature" : "someSignature" } ] }
- Parameters:
playerId
- the uuid of the player- Returns:
- the new
Skin
instance, or null if failed - Throws:
UserNotFoundException
- if the specified id does not match any users
-