Package com.mrivanplays.skins.api
Interface SkinsApi
-
public interface SkinsApi
Represents the main object of the skins api.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default Optional<Skin>
getOriginalSkin(@NotNull org.bukkit.entity.Player player)
Deprecated.default @NotNull MojangResponse
getOriginalSkinResponse(@NotNull org.bukkit.entity.Player player)
Gets the player's skin, which is set on the premium account of this player.Optional<Skin>
getSetSkin(@NotNull org.bukkit.entity.Player player)
Deprecated.this method will always take from cache without updating the skin, usegetSetSkinResponse(Player)
@NotNull MojangResponse
getSetSkinResponse(@NotNull org.bukkit.entity.Player player)
Gets the player's server set skin.@NotNull MojangResponse
getSkin(@NotNull String username)
Gets the skin of the specified username by fetchingUUID
and skin from theDataProvider
set.@Nullable MojangResponse
getSkullOwner(@NotNull org.bukkit.inventory.ItemStack item)
Returns the skull owner of the item, if the item is a skull item and was generated by theSkullItemBuilder
.@NotNull SkinsVersionInfo
getVersionInfo()
Returns the plugin's version info.default boolean
isSetSkinOriginal(@NotNull org.bukkit.entity.Player player)
Returns whenever the set skin of the specifiedPlayer
equals his original skin.@NotNull SkullItemBuilder
newSkullItemBuilder()
Creates a newSkullItemBuilder
void
setDataProvider(@NotNull DataProvider dataProvider)
Sets a new data provider, for fetching skin and uuid information.boolean
setSkin(@NotNull org.bukkit.entity.Player player, @NotNull MojangResponse skin)
Sets the skin of the specified player.
-
-
-
Method Detail
-
getSetSkin
@Deprecated Optional<Skin> getSetSkin(@NotNull @NotNull org.bukkit.entity.Player player)
Deprecated.this method will always take from cache without updating the skin, usegetSetSkinResponse(Player)
Gets the player's server set skin. This could also returngetOriginalSkin(Player)
due to how the plugin handles storing skins (to check that you can callisSetSkinOriginal(Player)
)- Parameters:
player
- the player you want to get the set skin of- Returns:
- optional of skin if the player have changed their skin, empty optional otherwise
-
getSetSkinResponse
@NotNull @NotNull MojangResponse getSetSkinResponse(@NotNull @NotNull org.bukkit.entity.Player player)
Gets the player's server set skin. This could also returngetOriginalSkin(Player)
due to how the plugin handles storing skins. The skin will be always updated if can.- Parameters:
player
- the player you want to get the set skin of- Returns:
- response
-
getOriginalSkin
@Deprecated default Optional<Skin> getOriginalSkin(@NotNull @NotNull org.bukkit.entity.Player player)
Deprecated.Gets the player's skin, which is set on the premium account of this player. This might be null if the specified player's nickname has no premium account.- Parameters:
player
- the player you want to get the original skin of- Returns:
- optional of skin if this player is in the data provider's database, empty optional otherwise
-
getOriginalSkinResponse
@NotNull default @NotNull MojangResponse getOriginalSkinResponse(@NotNull @NotNull org.bukkit.entity.Player player)
Gets the player's skin, which is set on the premium account of this player.- Parameters:
player
- the player you want to get the original skin of- Returns:
- response
- See Also:
getSkin(String)
-
isSetSkinOriginal
default boolean isSetSkinOriginal(@NotNull @NotNull org.bukkit.entity.Player player)
Returns whenever the set skin of the specifiedPlayer
equals his original skin.- Parameters:
player
- the player you want to check's skin- Returns:
true
if equal,false
otherwise
-
getSkin
@NotNull @NotNull MojangResponse getSkin(@NotNull @NotNull String username)
Gets the skin of the specified username by fetchingUUID
and skin from theDataProvider
set. The response is never null, however, the parts into the response may be null if the data provider wasn't able to fetch them, for one reason or another. It is recommended to run this asynchronously.- Parameters:
username
- the username of the premium account you want to get skin- Returns:
- response with all data, or response with none data if data provider wasn't able to fetch it
-
setSkin
boolean setSkin(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull MojangResponse skin)
Sets the skin of the specified player.- Parameters:
player
- the player you want to set the skin ofskin
- the skin in response form that you want to set on the player- Returns:
- whether or not the skin change was successful
-
newSkullItemBuilder
@NotNull @NotNull SkullItemBuilder newSkullItemBuilder()
Creates a newSkullItemBuilder
- Returns:
- skull item builder
- See Also:
SkullItemBuilder
-
setDataProvider
void setDataProvider(@NotNull @NotNull DataProvider dataProvider)
Sets a new data provider, for fetching skin and uuid information.- Parameters:
dataProvider
- data provider
-
getVersionInfo
@NotNull @NotNull SkinsVersionInfo getVersionInfo()
Returns the plugin's version info.- Returns:
- detailed information object about the version of the plugin, implementing this api.
-
getSkullOwner
@Nullable @Nullable MojangResponse getSkullOwner(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
Returns the skull owner of the item, if the item is a skull item and was generated by theSkullItemBuilder
.- Parameters:
item
- item you want to get the skull owner of- Returns:
- response
-
-