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.
  • Method Details

    • getSkinIdOfPlayer

      Optional<SkinIdentifier> getSkinIdOfPlayer(UUID uuid)
      Get the linked skin identifier of a player.
      Parameters:
      uuid - Players UUID
      Returns:
      The skin identifier of the player
    • setSkinIdOfPlayer

      void setSkinIdOfPlayer(UUID uuid, SkinIdentifier identifier)
      Links a player to a skin identifier.
      Parameters:
      uuid - Players UUID
      identifier - Skin identifier to link
    • removeSkinIdOfPlayer

      void removeSkinIdOfPlayer(UUID uuid)
      Removes the link between the player and a skin identifier.
      Parameters:
      uuid - Players UUID
    • getSkinOfPlayer

      Optional<SkinProperty> getSkinOfPlayer(UUID uuid)
      Calls getSkinIdOfPlayer(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 UUID
      playerName - Players name
      isOnlineMode - 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: