Add setPlayerProfile API for Skulls
This allows you to create already filled textures on Skulls to avoid texture lookups which commonly cause rate limit issues with Mojang API
This commit is contained in:
@@ -38,6 +38,20 @@ public interface SkullMeta extends ItemMeta {
|
||||
@Deprecated(since = "1.12.1")
|
||||
boolean setOwner(@Nullable String owner);
|
||||
|
||||
// Paper start
|
||||
/**
|
||||
* Sets this skull to use the supplied Player Profile, which can include textures already prefilled.
|
||||
* @param profile The profile to set this Skull to use, or null to clear owner
|
||||
*/
|
||||
void setPlayerProfile(@Nullable com.destroystokyo.paper.profile.PlayerProfile profile);
|
||||
|
||||
/**
|
||||
* If the skull has an owner, per {@link #hasOwner()}, return the owners {@link com.destroystokyo.paper.profile.PlayerProfile}
|
||||
* @return The profile of the owner, if set
|
||||
*/
|
||||
@Nullable com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile();
|
||||
// Paper end
|
||||
|
||||
/**
|
||||
* Gets the owner of the skull.
|
||||
*
|
||||
@@ -64,6 +78,7 @@ public interface SkullMeta extends ItemMeta {
|
||||
* @return the profile of the owning player
|
||||
*/
|
||||
@Nullable
|
||||
@Deprecated // Paper
|
||||
PlayerProfile getOwnerProfile();
|
||||
|
||||
/**
|
||||
@@ -78,6 +93,7 @@ public interface SkullMeta extends ItemMeta {
|
||||
* @throws IllegalArgumentException if the profile does not contain the
|
||||
* necessary information
|
||||
*/
|
||||
@Deprecated // Paper
|
||||
void setOwnerProfile(@Nullable PlayerProfile profile);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user