Package net.citizensnpcs.npc.skin
Class Skin
java.lang.Object
net.citizensnpcs.npc.skin.Skin
Stores data for a single skin.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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
Clear all cached skins.static Skin
Get a player skin.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.Get the ID of the player the skin belongs to.Get the name of the skin.boolean
Determine if the skin data has been retrieved.boolean
isValid()
Determine if the skin is valid.
-
Field Details
-
CACHED_SKIN_UUID_METADATA
- See Also:
-
CACHED_SKIN_UUID_NAME_METADATA
- See Also:
-
-
Method Details
-
apply
Apply the skin data to the specified skinnable 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.
- Parameters:
entity
- The skinnable entity.- Returns:
- True if skin was applied, false if the data is being retrieved.
-
applyAndRespawn
Apply the skin data to the specified skinnable entity and respawn the NPC.- Parameters:
entity
- The skinnable entity.
-
getSkinId
Get the ID of the player the skin belongs to.- Returns:
- The skin ID or null if it has not been retrieved yet or the skin is invalid.
-
getSkinName
Get the name of the skin. -
hasSkinData
public boolean hasSkinData()Determine if the skin data has been retrieved. -
isValid
public boolean isValid()Determine if the skin is valid. -
clearCache
public static void clearCache()Clear all cached skins. -
get
Get a skin for a skinnable entity.If a Skin instance does not exist, a new one is created and the skin data is automatically fetched.
- Parameters:
entity
- The skinnable entity.
-
get
Get a skin for a skinnable entity.If a Skin instance does not exist, a new one is created and the skin data is automatically fetched.
- Parameters:
entity
- The skinnable entity.forceUpdate
- if the skin should be checked via the cache
-
get
Get a player skin.If a Skin instance does not exist, a new one is created and the skin data is automatically fetched.
- Parameters:
skinName
- The name of the skin.
-