Package xyz.xenondevs.invui.item.builder
Class SkullBuilder.HeadTexture
java.lang.Object
xyz.xenondevs.invui.item.builder.SkullBuilder.HeadTexture
- All Implemented Interfaces:
Serializable
- Enclosing class:
SkullBuilder
Contains the texture value for a player head.
- See Also:
-
Constructor Summary
ConstructorDescriptionHeadTexture
(@NotNull String textureValue) Creates a newSkullBuilder.HeadTexture
from the raw texture value. -
Method Summary
Modifier and TypeMethodDescription@NotNull String
Gets the stored texture value.static void
Invalidates the uuid and texture value cache.static @NotNull SkullBuilder.HeadTexture
Retrieves theSkullBuilder.HeadTexture
from the username of the skull owner.static @NotNull SkullBuilder.HeadTexture
Retrieves theSkullBuilder.HeadTexture
from theUUID
of the skull owner.static @NotNull SkullBuilder.HeadTexture
of
(@NotNull org.bukkit.OfflinePlayer offlinePlayer) Retrieves theSkullBuilder.HeadTexture
from thisOfflinePlayer
Please note that this data might not be pulled from the Mojang API as it might already be cached.
-
Constructor Details
-
HeadTexture
Creates a newSkullBuilder.HeadTexture
from the raw texture value.- Parameters:
textureValue
- The texture value of thisSkullBuilder.HeadTexture
- See Also:
-
-
Method Details
-
of
@NotNull public static @NotNull SkullBuilder.HeadTexture of(@NotNull @NotNull org.bukkit.OfflinePlayer offlinePlayer) throws MojangApiUtils.MojangApiException, IOException Retrieves theSkullBuilder.HeadTexture
from thisOfflinePlayer
Please note that this data might not be pulled from the Mojang API as it might already be cached. UseinvalidateCache()
to invalidate the cache.- Parameters:
offlinePlayer
- The skull owner.- Returns:
- The
SkullBuilder.HeadTexture
of that player. - Throws:
MojangApiUtils.MojangApiException
- If the Mojang API returns an error.IOException
- If an I/O error occurs.- See Also:
-
of
@NotNull public static @NotNull SkullBuilder.HeadTexture of(@NotNull @NotNull String playerName) throws MojangApiUtils.MojangApiException, IOException Retrieves theSkullBuilder.HeadTexture
from the username of the skull owner. This will first retrieve theUUID
of the player from either Bukkit's usercache.json file (if the server is in only mode) or from the Mojang API (if the server is in offline mode).Please note that this data might not be pulled from the Mojang API as it might already be cached. Use
invalidateCache()
to invalidate the cache.- Parameters:
playerName
- The username of the player.- Returns:
- The
SkullBuilder.HeadTexture
of that player. - Throws:
MojangApiUtils.MojangApiException
- If the Mojang API returns an error.IOException
- If an I/O error occurs.- See Also:
-
of
@NotNull public static @NotNull SkullBuilder.HeadTexture of(@NotNull @NotNull UUID uuid) throws MojangApiUtils.MojangApiException, IOException Retrieves theSkullBuilder.HeadTexture
from theUUID
of the skull owner. Please note that this data might not be pulled from the Mojang API as it might already be cached. UseinvalidateCache()
to invalidate the cache.- Parameters:
uuid
- TheUUID
of the skull owner.- Returns:
- The
SkullBuilder.HeadTexture
of that player. - Throws:
MojangApiUtils.MojangApiException
- If the Mojang API returns an error.IOException
- If an I/O error occurs.
-
invalidateCache
public static void invalidateCache()Invalidates the uuid and texture value cache. This means that whenof(OfflinePlayer)
,of(UUID)
andof(String)
are called, these values will be pulled from the Mojang API again. -
getTextureValue
Gets the stored texture value.- Returns:
- The stored texture value.
-