Class SkullTexture.PlayerDB
java.lang.Object
com.saicone.rtag.util.SkullTexture
com.saicone.rtag.util.SkullTexture.PlayerDB
- Enclosing class:
SkullTexture
PlayerDB SkullTexture implementation that retrieves profiles using PlayerDB API.
-
Nested Class Summary
Nested classes/interfaces inherited from class SkullTexture
SkullTexture.CraftHead, SkullTexture.Mojang, SkullTexture.PlayerDB, SkullTexture.Profile -
Field Summary
Fields inherited from class SkullTexture
cache, executor -
Constructor Summary
ConstructorsConstructorDescriptionPlayerDB()Constructs a SkullTexture instance with default parameters.PlayerDB(@Nullable com.google.common.cache.Cache<String, SkullTexture.Profile> cache) Constructs a SkullTexture instance with provided cache object.PlayerDB(@Nullable com.google.common.cache.Cache<String, SkullTexture.Profile> cache, @NotNull Executor executor) Constructs a SkullTexture instance with provided cache object and executor.Constructs a SkullTexture instance with provided executor. -
Method Summary
Modifier and TypeMethodDescriptionprotected @NotNull SkullTexture.ProfileFetch player profile using player name or id.fetchProfile(@NotNull String name) Fetch profile value using player name.fetchProfile(@NotNull UUID uniqueId) Fetch profile value using player unique id.Methods inherited from class SkullTexture
caching, computePlayerTexture, computePlayerTexture, craftHead, encodeUrl, encodeUrlId, fetchJson, getProfile, getProfile, getTexturedHead, getTexturedHead, getTextureValue, getTextureValue, item, itemAsync, itemAsync, mojang, playerDB, profileFrom, profileFromId, profileFromId, profileFromName, profileFromPlayer, profileSession, requestTextureUrl, setProfile, setTexture
-
Constructor Details
-
PlayerDB
public PlayerDB()Constructs a SkullTexture instance with default parameters. -
PlayerDB
public PlayerDB(@Nullable @Nullable com.google.common.cache.Cache<String, SkullTexture.Profile> cache) Constructs a SkullTexture instance with provided cache object.- Parameters:
cache- the cache to save encoded textures.
-
PlayerDB
-
PlayerDB
public PlayerDB(@Nullable @Nullable com.google.common.cache.Cache<String, SkullTexture.Profile> cache, @NotNull @NotNull Executor executor) Constructs a SkullTexture instance with provided cache object and executor.- Parameters:
cache- the cache to save encoded textures.executor- the default executor to use in async operations.
-
-
Method Details
-
fetchProfile
Description copied from class:SkullTextureFetch profile value using player name.- Overrides:
fetchProfilein classSkullTexture- Parameters:
name- the player name to find.- Returns:
- a profile value if found,
SkullTexture.Profile.empty()otherwise.
-
fetchProfile
Description copied from class:SkullTextureFetch profile value using player unique id.- Overrides:
fetchProfilein classSkullTexture- Parameters:
uniqueId- the unique id to find.- Returns:
- a profile value if found,
SkullTexture.Profile.empty()otherwise.
-
fetchAny
Fetch player profile using player name or id.- Parameters:
any- the name or id to find.- Returns:
- a profile value if found,
SkullTexture.Profile.empty()otherwise.
-