public class Skin extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CACHED_SKIN_UUID_METADATA |
static String |
CACHED_SKIN_UUID_NAME_METADATA |
Modifier and Type | Method and Description |
---|---|
boolean |
apply(SkinnableEntity entity)
Apply the skin data to the specified skinnable entity.
|
void |
applyAndRespawn(SkinnableEntity entity)
Apply the skin data to the specified skinnable entity and respawn the NPC.
|
static void |
clearCache()
Clear all cached skins.
|
static Skin |
get(SkinnableEntity entity)
Get a skin for a skinnable entity.
|
static Skin |
get(SkinnableEntity entity,
boolean forceUpdate)
Get a skin for a skinnable entity.
|
static Skin |
get(String skinName,
boolean forceUpdate)
Get a player skin.
|
UUID |
getSkinId()
Get the ID of the player the skin belongs to.
|
String |
getSkinName()
Get the name of the skin.
|
boolean |
hasSkinData()
Determine if the skin data has been retrieved.
|
boolean |
isValid()
Determine if the skin is valid.
|
public static final String CACHED_SKIN_UUID_METADATA
public static final String CACHED_SKIN_UUID_NAME_METADATA
public boolean apply(SkinnableEntity entity)
If invoked before the skin data is ready, the skin is retrieved and the skin is automatically applied to the entity at a later time.
entity
- The skinnable entity.public void applyAndRespawn(SkinnableEntity entity)
entity
- The skinnable entity.@Nullable public UUID getSkinId()
public String getSkinName()
public boolean hasSkinData()
public boolean isValid()
public static void clearCache()
public static Skin get(SkinnableEntity entity)
If a Skin instance does not exist, a new one is created and the skin data is automatically fetched.
entity
- The skinnable entity.public static Skin get(SkinnableEntity entity, boolean forceUpdate)
If a Skin instance does not exist, a new one is created and the skin data is automatically fetched.
entity
- The skinnable entity.forceUpdate
- if the skin should be checked via the cacheCopyright © 2021. All rights reserved.