Interface CapeService


public interface CapeService
Shows or hides the account's capes. The account's owned capes come from the profile read (ProfileService.fetch() → PlayerProfile.capes()), so there is no separate list call.

Not designed for host implementation; methods may be added in minor releases.

Since:
0.11.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Hides whatever cape is shown.
    Hides whatever cape is shown and returns the profile as it stands afterwards, the way setActive(String) does.
    Returns the capes the account owns, as a convenience over reading them off the profile.
    setActive(String capeId)
    Shows the cape with the given id.
  • Method Details

    • owned

      List<Cape> owned()
      Returns the capes the account owns, as a convenience over reading them off the profile.
      Returns:
      the owned capes
      Throws:
      AltsException - if the token was refused or the service failed
      Since:
      0.11.0
    • setActive

      PlayerProfile setActive(String capeId)
      Shows the cape with the given id.
      Parameters:
      capeId - the cape id (from Cape.id())
      Returns:
      the updated profile
      Throws:
      AltsException - if the token was refused or the cape is not owned
      Since:
      0.11.0
    • hide

      void hide()
      Hides whatever cape is shown.
      Throws:
      AltsException - if the token was refused or the service failed
      Since:
      0.11.0
    • hideActive

      default PlayerProfile hideActive()
      Hides whatever cape is shown and returns the profile as it stands afterwards, the way setActive(String) does.
      Returns:
      the updated profile, or null when the service confirmed the change without sending one back
      Throws:
      AltsException - if the token was refused or the service failed
      Since:
      0.12.0