Interface App


public interface App
The class manages users in JPremium. All force method are thread-safe. Every force method requires a user. Some of them requires entering other arguments. All force method names and their arguments represent what they do, so they do not have any additional javadocs. ! It is not the final version of the API. It may be changed in next versions !
  • Method Details

    • getUserProfiles

      Set<? extends User> getUserProfiles()
      Returns a copy set of all users on the server.
      Returns:
      the set object contains users.
    • getUserProfileByUniqueId

      Optional<? extends User> getUserProfileByUniqueId(UUID uniqueId)
      Returns the user with the given unique id, or an empty optional if not available.
      Parameters:
      uniqueId - a unique id to search.
      Returns:
      the user object.
    • getUserProfileByPremiumId

      Optional<? extends User> getUserProfileByPremiumId(UUID premiumId)
      Returns the user with the given premium id, or an empty optional if not available. A premium id is an unique id which represents a specified premium player. You can get a premium id from https://api.mojang.com/users/profiles/minecraft/Jakubson.
      Parameters:
      premiumId - a premium id to search.
      Returns:
      the user object.
    • getUserProfileByNickname

      Optional<? extends User> getUserProfileByNickname(String nickname)
      Returns the user with the given nickname, or an empty optional if not available. If a premium player changed the nickname, but the player has not been on the server from that time (or anybody else with the old nickname), you need to use the old nickname to search the premium player. In some cases a premium user may have no any nickname, so you cannot search the player by the nickname then. You need to use getUserProfileByPremiumId(UUID premiumId).
      Parameters:
      nickname - a nickname to search.
      Returns:
      the user object.
    • fetchUserProfileByUniqueId

      Optional<? extends User> fetchUserProfileByUniqueId(UUID uniqueId)
    • fetchUserProfileByPremiumId

      Optional<? extends User> fetchUserProfileByPremiumId(UUID uniqueId)
    • fetchUserProfileByNickname

      Optional<? extends User> fetchUserProfileByNickname(String nickname)
    • forceLogin

      void forceLogin(User user)
    • forceRegister

      void forceRegister(User user, String password)
    • forceUnregister

      void forceUnregister(User user)
    • forceChangePassword

      void forceChangePassword(User user, String password)
    • forceCreatePassword

      void forceCreatePassword(User user, String password)
    • forcePremium

      void forcePremium(User user)
    • forceCracked

      void forceCracked(User user)
    • forceStartSession

      void forceStartSession(User user)
    • forceDestroySession

      void forceDestroySession(User user)
    • forceChangeEmailAddress

      void forceChangeEmailAddress(User user, String emailAddress)
    • forcePurgeUserProfile

      void forcePurgeUserProfile(User user)
    • forceRecoveryPassword

      @Deprecated void forceRecoveryPassword(User user)
      Deprecated.
    • validatePassword

      boolean validatePassword(User user, String password)
      Returns true if the given password is correct for the given user, or false if not. Throws IllegalStateException if the given user does not have a password.
      Parameters:
      user - a user object which a password should be validated.
      password - a password to validate.
      Returns:
      the state of validation.
    • validateSecondFactorCode

      boolean validateSecondFactorCode(User user, int code)
      Returns true if the given a 2FA code is correct for the given user, or false if not. Throws IllegalStateException if the given user does not have 2FA enabled.
      Parameters:
      user - a user object which a 2FA code should be validated.
      code - a 2FA code to validate.
      Returns:
      the state of validation.