Package net.skinsrestorer.api.storage
Interface PlayerStorage
public interface PlayerStorage
This interface is used to store and retrieve skin data for players.
Internally a player is stored by their UUID and is linked to a skin identifier.
Internally a player is stored by their UUID and is linked to a skin identifier.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<SkinProperty>
getSkinForPlayer
(UUID uuid, String playerName) getSkinForPlayer
(UUID uuid, String playerName, boolean isOnlineMode) This method seeks out the skin that would be set on join and returns the property containing all the skin data (Value and Signature).getSkinIdOfPlayer
(UUID uuid) Get the linked skin identifier of a player.getSkinOfPlayer
(UUID uuid) CallsgetSkinIdOfPlayer(UUID)
and fetches the stored skin property from the skin identifier.void
removeSkinIdOfPlayer
(UUID uuid) Removes the link between the player and a skin identifier.void
setSkinIdOfPlayer
(UUID uuid, SkinIdentifier identifier) Links a player to a skin identifier.
-
Method Details
-
getSkinIdOfPlayer
Get the linked skin identifier of a player.- Parameters:
uuid
- Players UUID- Returns:
- The skin identifier of the player
-
setSkinIdOfPlayer
Links a player to a skin identifier.- Parameters:
uuid
- Players UUIDidentifier
- Skin identifier to link
-
removeSkinIdOfPlayer
Removes the link between the player and a skin identifier.- Parameters:
uuid
- Players UUID
-
getSkinOfPlayer
CallsgetSkinIdOfPlayer(UUID)
and fetches the stored skin property from the skin identifier.- Parameters:
uuid
- Players UUID- Returns:
- The skin property of the player or empty if no identifier is linked or data is missing.
-
getSkinForPlayer
Optional<SkinProperty> getSkinForPlayer(UUID uuid, String playerName, boolean isOnlineMode) throws DataRequestException This method seeks out the skin that would be set on join and returns the property containing all the skin data (Value and Signature). That skin can either be custom set, the premium skin or a default skin. It also executes a skin data update if the saved skin data expired.The isOnlineMode parameter is used to determine whether the player is connected via online mode, so we may skip default skins for that player if configured by the admin.
- Parameters:
uuid
- Players UUIDplayerName
- Players nameisOnlineMode
- Whether the player gets properties from the platform already- Returns:
- The skin identifier of the skin that would be set on join
- Throws:
DataRequestException
-
getSkinForPlayer
default Optional<SkinProperty> getSkinForPlayer(UUID uuid, String playerName) throws DataRequestException - Throws:
DataRequestException
- See Also:
-