接口 ProfileService
public interface ProfileService
Provides game profile apis.
-
方法概要
修饰符和类型方法说明fillProperties(GameProfile profile) Fetches the properties of the profile and returns it as aPropertiesGameProfile.getGameProfile(UUID profileUUID) Returns the specified player's profile, or null if the player doesn't exist.getTextures(PropertiesGameProfile profile) Returns the specified player's textures.lookupGameProfile(String name) Returns the profile of the player that uses the specified username, or null if no such a player exists.lookupGameProfile(String name, long timestamp) Returns the profile of the player that uses the specified username at the timestamp provided, or null if no such a player exists.voidlookupGameProfiles(Set<String> names, GameProfileCallback callback) Queries the profiles of the given players.
-
方法详细资料
-
getGameProfile
PropertiesGameProfile getGameProfile(UUID profileUUID) throws org.to2mbn.jmccc.auth.AuthenticationException Returns the specified player's profile, or null if the player doesn't exist.For Mojang implementation: This method has a strict rate limit: You can request the same profile once per minute, however, you can send as many unique requests as you like. So you'd better cache the profiles.
- 参数:
profileUUID- the player's uuid- 返回:
- the specified player's profile, null if the player doesn't exist
- 抛出:
org.to2mbn.jmccc.auth.AuthenticationException- if an exception occurs during requesting
-
fillProperties
PropertiesGameProfile fillProperties(GameProfile profile) throws org.to2mbn.jmccc.auth.AuthenticationException Fetches the properties of the profile and returns it as aPropertiesGameProfile. If the profile is already aPropertiesGameProfile, nothing will be done.This method has a rate limit, see
getGameProfile(UUID).- 参数:
profile- the profile- 返回:
- the profile with properties
- 抛出:
org.to2mbn.jmccc.auth.AuthenticationException- if an exception occurs during requesting
-
getTextures
Map<TextureType,Texture> getTextures(PropertiesGameProfile profile) throws org.to2mbn.jmccc.auth.AuthenticationException Returns the specified player's textures.- 参数:
profile- the player's profile- 返回:
- the player's textures, can be null
- 抛出:
org.to2mbn.jmccc.auth.AuthenticationException- if an exception occurs during requesting
-
lookupGameProfile
Returns the profile of the player that uses the specified username, or null if no such a player exists.- 参数:
name- the player's name- 返回:
- the profile of the player that uses the specified username, or null if no such a player exists
- 抛出:
org.to2mbn.jmccc.auth.AuthenticationException- if an exception occurs during requesting
-
lookupGameProfile
GameProfile lookupGameProfile(String name, long timestamp) throws org.to2mbn.jmccc.auth.AuthenticationException Returns the profile of the player that uses the specified username at the timestamp provided, or null if no such a player exists.- 参数:
name- the player's nametimestamp- the timestamp (java timestamp)- 返回:
- the profile of the player that uses the specified username at the timestamp provided, or null if no such a player exists
- 抛出:
org.to2mbn.jmccc.auth.AuthenticationException- if an exception occurs during requesting
-
lookupGameProfiles
Queries the profiles of the given players. The method will block until all the profiles are queried. Once a profile is queried,callbackwill be called.- 参数:
names- the players' namescallback- the callback
-