Package com.jakub.jpremium.proxy.api
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 Summary
Modifier and TypeMethodDescriptionfetchUserProfileByNickname
(String nickname) fetchUserProfileByPremiumId
(UUID uniqueId) fetchUserProfileByUniqueId
(UUID uniqueId) void
forceChangeEmailAddress
(User user, String emailAddress) void
forceChangePassword
(User user, String password) void
forceCracked
(User user) void
forceCreatePassword
(User user, String password) void
forceDestroySession
(User user) void
forceLogin
(User user) void
forcePremium
(User user) void
forcePurgeUserProfile
(User user) void
forceRecoveryPassword
(User user) Deprecated.void
forceRegister
(User user, String password) void
forceStartSession
(User user) void
forceUnregister
(User user) getUserProfileByNickname
(String nickname) Returns the user with the given nickname, or an empty optional if not available.getUserProfileByPremiumId
(UUID premiumId) Returns the user with the given premium id, or an empty optional if not available.getUserProfileByUniqueId
(UUID uniqueId) Returns the user with the given unique id, or an empty optional if not available.Returns a copy set of all users on the server.boolean
validatePassword
(User user, String password) Returns true if the given password is correct for the given user, or false if not.boolean
validateSecondFactorCode
(User user, int code) Returns true if the given a 2FA code is correct for the given user, or false if not.
-
Method Details
-
getUserProfiles
Returns a copy set of all users on the server.- Returns:
- the set object contains users.
-
getUserProfileByUniqueId
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
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
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 usegetUserProfileByPremiumId(UUID premiumId)
.- Parameters:
nickname
- a nickname to search.- Returns:
- the user object.
-
fetchUserProfileByUniqueId
-
fetchUserProfileByPremiumId
-
fetchUserProfileByNickname
-